Changeset 18265 in josm


Ignore:
Timestamp:
2021-10-10T01:04:11+02:00 (3 years ago)
Author:
Don-vip
Message:

fix new defects reported by coverity

Location:
trunk/src/org/openstreetmap/josm/gui
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/download/BookmarkSelection.java

    r18211 r18265  
    309309                return;
    310310            Bookmark b = bookmarks.getModel().getElementAt(idx);
    311             parent.startDownload(b.getArea());
     311            if (b != null) {
     312                parent.startDownload(b.getArea());
     313            }
    312314        }
    313315    }
  • trunk/src/org/openstreetmap/josm/gui/layer/geoimage/GeoImageLayer.java

    r18263 r18265  
    483483
    484484    protected static void drawDirectionArrow(Graphics2D g, Point p, double dir, Dimension imgDim) {
    485         System.out.println(dir);
    486485        // Multiplier must be larger than sqrt(2)/2=0.71.
    487486        double arrowlength = Math.max(25, Math.max(imgDim.width, imgDim.height) * 0.85);
  • trunk/src/org/openstreetmap/josm/gui/tagging/presets/items/MultiSelect.java

    r18260 r18265  
    8383            // and size the scrollpane accordingly.
    8484            Rectangle r = list.getCellBounds(0, Math.min(rows, model.size() - 1));
    85             Insets insets = list.getInsets();
    86             r.width += insets.left + insets.right;
    87             r.height += insets.top + insets.bottom;
    88             insets = sp.getInsets();
    89             r.width += insets.left + insets.right;
    90             r.height += insets.top + insets.bottom;
    91             sp.setPreferredSize(new Dimension(r.width, r.height));
     85            if (r != null) {
     86                Insets insets = list.getInsets();
     87                r.width += insets.left + insets.right;
     88                r.height += insets.top + insets.bottom;
     89                insets = sp.getInsets();
     90                r.width += insets.left + insets.right;
     91                r.height += insets.top + insets.bottom;
     92                sp.setPreferredSize(new Dimension(r.width, r.height));
     93            }
    9294        }
    9395        p.add(sp, GBC.eol().fill(GBC.HORIZONTAL)); // NOSONAR
Note: See TracChangeset for help on using the changeset viewer.