Merge branch 'subtree'
[fanfix.git] / src / be / nikiroo / fanfix / supported / BasicSupport.java
index bcfcca1bdbb16cfd3bd8849e8fdb2bfb55a22de0..9b56f885d94a14ff1025b3833aa34209c48374dd 100644 (file)
@@ -276,8 +276,10 @@ public abstract class BasicSupport {
                MetaData meta = getMeta();
                meta.setType(getType().toString());
                meta.setSource(getType().getSourceName());
-               meta.setPublisher(getType().getSourceName());
-               
+               if (meta.getPublisher() == null) {
+                       meta.setPublisher(getType().getSourceName());
+               }
+
                if (meta.getCreationDate() == null
                                || meta.getCreationDate().trim().isEmpty()) {
                        meta.setCreationDate(bsHelper
@@ -352,6 +354,9 @@ public abstract class BasicSupport {
                        Scanner scan = new Scanner(in);
                        scan.useDelimiter("\0");
                        try {
+                               if(!scan.hasNext())
+                                       throw new IOException("The given input was empty");
+                               
                                return new JSONObject(scan.next());
                        } catch (JSONException e) {
                                throw new IOException(e);