OSDN Git Service

fixed:
authorhaya4 <hayashi.yuu@gmail.com>
Sun, 20 Oct 2019 03:44:50 +0000 (12:44 +0900)
committerhaya4 <hayashi.yuu@gmail.com>
Sun, 20 Oct 2019 03:44:50 +0000 (12:44 +0900)
src/osm/jp/gpx/matchtime/gui/restamp/DialogCorectTime.java

index 67fe187..e026cce 100644 (file)
@@ -154,16 +154,21 @@ public class DialogCorectTime extends JDialog implements PanelAction {
      */
     @SuppressWarnings("UseSpecificCatch")
     public void imageView_Action() {
-        String path = basetime.getImageFile().getImageFile().getAbsolutePath();
+        try {
+            String path = basetime.getImageFile().getImageFile().getAbsolutePath();
 
-        // View Image File
-        int size_x = imageSPane.getWidth() - 8;
-        ImageIcon tmpIcon = new ImageIcon(path);
-        refImage = tmpIcon;
-        if (tmpIcon.getIconWidth() > size_x) {
-            refImage = new ImageIcon(tmpIcon.getImage().getScaledInstance(size_x, -1, Image.SCALE_DEFAULT));
+            // View Image File
+            int size_x = imageSPane.getWidth() - 8;
+            ImageIcon tmpIcon = new ImageIcon(path);
+            refImage = tmpIcon;
+            if (tmpIcon.getIconWidth() > size_x) {
+                refImage = new ImageIcon(tmpIcon.getImage().getScaledInstance(size_x, -1, Image.SCALE_DEFAULT));
+            }
+            imageLabel.setIcon(refImage);
+        }
+        catch(NullPointerException e) {
+            // 何もしない
         }
-        imageLabel.setIcon(refImage);
         repaint();
     }