Merge branch 'subtree'
authorNiki Roo <niki@nikiroo.be>
Wed, 6 May 2020 15:25:53 +0000 (17:25 +0200)
committerNiki Roo <niki@nikiroo.be>
Wed, 6 May 2020 15:25:53 +0000 (17:25 +0200)
src/be/nikiroo/fanfix/Main.java
src/be/nikiroo/fanfix/supported/BasicSupport.java
src/be/nikiroo/fanfix/supported/E621.java

index 2e8b6d17cdc7dc99b17353df55aefd469ef4a0a8..9d9592eefd3356e9d7c1e61b9e0b5142ab7b2376 100644 (file)
@@ -126,6 +126,9 @@ public class Main {
 
                int exitCode = 0;
                for (int i = 0; exitCode == 0 && i < args.length; i++) {
+                       if (args[i] == null)
+                               continue;
+
                        // Action (--) handling:
                        if (!noMoreActions && args[i].startsWith("--")) {
                                if (args[i].equals("--")) {
index f1635589bfd70b0dca80b5972dcfd241bda895f8..56a3bb80cb6d51fe40a9c4d830e12cb275102d76 100644 (file)
@@ -12,6 +12,7 @@ import java.util.Map;
 import java.util.Scanner;
 import java.util.Map.Entry;
 
+import org.json.JSONException;
 import org.json.JSONObject;
 import org.jsoup.helper.DataUtil;
 import org.jsoup.nodes.Document;
@@ -347,6 +348,8 @@ public abstract class BasicSupport {
                        scan.useDelimiter("\0");
                        try {
                                return new JSONObject(scan.next());
+                       } catch (JSONException e) {
+                               throw new IOException(e);
                        } finally {
                                scan.close();
                        }
index dc7cb1b3b8b6e468f0a44ecc091dabf6c5f9a6e7..adf8d28c8b2853a01fddc02b239346bec9f28a0e 100644 (file)
@@ -7,7 +7,6 @@ import java.net.URL;
 import java.net.URLDecoder;
 import java.util.AbstractMap;
 import java.util.ArrayList;
-import java.util.Collections;
 import java.util.Date;
 import java.util.LinkedList;
 import java.util.List;