X-Git-Url: http://git.nikiroo.be/?a=blobdiff_plain;f=supported%2FBasicSupport.java;h=9b56f885d94a14ff1025b3833aa34209c48374dd;hb=bb7d9ea97cc614a04dd45f342a4caeeb7dcb23fe;hp=bcfcca1bdbb16cfd3bd8849e8fdb2bfb55a22de0;hpb=258e065f81071a861711ef935dca3ec5563f4360;p=fanfix.git diff --git a/supported/BasicSupport.java b/supported/BasicSupport.java index bcfcca1..9b56f88 100644 --- a/supported/BasicSupport.java +++ b/supported/BasicSupport.java @@ -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);