Small fixes: update check, epub:
authorNiki Roo <niki@nikiroo.be>
Sat, 15 Jul 2017 07:32:26 +0000 (09:32 +0200)
committerNiki Roo <niki@nikiroo.be>
Sat, 15 Jul 2017 07:32:26 +0000 (09:32 +0200)
- update check will now be more clear when it cannot contact github.com
- epub support will now fail with "epub not supported" instead of NPE

src/be/nikiroo/fanfix/VersionCheck.java
src/be/nikiroo/fanfix/supported/Epub.java

index be7fb919cb376f939457a989298deffd626af17e..7f8d1a06247b246345e5f8f52ae21498a51cb922 100644 (file)
@@ -141,7 +141,8 @@ public class VersionCheck {
                                        reader.close();
                                }
                        } catch (IOException e) {
-                               Instance.syserr(e);
+                               Instance.syserr(new IOException(
+                                               "Cannot download latest changelist on github.com", e));
                        }
                }
 
index 0bd09bdc4f24e7560fda61e40ef4e82c0e5c227c..bd5c7191a86fe687942a6411c4291ff9010ad060 100644 (file)
@@ -97,7 +97,7 @@ class Epub extends InfoText {
                        if (!entry.isDirectory()
                                        && entry.getName().startsWith(getDataPrefix())) {
                                String entryLName = entry.getName().toLowerCase();
-
+                               
                                boolean imageEntry = false;
                                for (String ext : getImageExt(false)) {
                                        if (entryLName.endsWith(ext)) {
@@ -166,7 +166,10 @@ class Epub extends InfoText {
 
                tmp = null;
 
-               fakeIn.close();
+               if (fakeIn != null) {
+                       fakeIn.close();
+               }
+
                super.close();
        }