From a54917bee8615698ecbfdd5bd8c2e1a0ed4438e6 Mon Sep 17 00:00:00 2001 From: Nathan Dunn Date: Sun, 21 Mar 2021 05:16:29 -0700 Subject: [PATCH] fixes #2595 --- .../bbop/apollo/gwt/client/dto/GeneProductConverter.java | 8 +++++++- .../bbop/apollo/gwt/client/dto/GoAnnotationConverter.java | 8 +++++++- .../bbop/apollo/gwt/client/dto/ProvenanceConverter.java | 8 +++++++- 3 files changed, 21 insertions(+), 3 deletions(-) diff --git a/src/gwt/org/bbop/apollo/gwt/client/dto/GeneProductConverter.java b/src/gwt/org/bbop/apollo/gwt/client/dto/GeneProductConverter.java index 108401fd02..375e7dbf29 100644 --- a/src/gwt/org/bbop/apollo/gwt/client/dto/GeneProductConverter.java +++ b/src/gwt/org/bbop/apollo/gwt/client/dto/GeneProductConverter.java @@ -41,7 +41,13 @@ public static GeneProduct convertFromJson(JSONObject object) { String withOrFromString = object.get("withOrFrom").isString().stringValue(); JSONArray withOrFromArray = JSONParser.parseLenient(withOrFromString).isArray(); for (int i = 0; i < withOrFromArray.size(); i++) { - WithOrFrom withOrFrom = new WithOrFrom(withOrFromArray.get(i).isString().stringValue()); + WithOrFrom withOrFrom ; + if(withOrFromArray.get(i).isString()!=null){ + withOrFrom = new WithOrFrom(withOrFromArray.get(i).isString().stringValue()); + } + else{ + withOrFrom = new WithOrFrom("Value is an error, please edit or delete: "+withOrFromArray.get(i)); + } withOrFromList.add(withOrFrom); } } diff --git a/src/gwt/org/bbop/apollo/gwt/client/dto/GoAnnotationConverter.java b/src/gwt/org/bbop/apollo/gwt/client/dto/GoAnnotationConverter.java index 17d8a568f4..ea72ae1499 100644 --- a/src/gwt/org/bbop/apollo/gwt/client/dto/GoAnnotationConverter.java +++ b/src/gwt/org/bbop/apollo/gwt/client/dto/GoAnnotationConverter.java @@ -52,7 +52,13 @@ public static GoAnnotation convertFromJson(JSONObject object) { String withOrFromString = object.get("withOrFrom").isString().stringValue(); JSONArray withOrFromArray = JSONParser.parseLenient(withOrFromString).isArray(); for (int i = 0; i < withOrFromArray.size(); i++) { - WithOrFrom withOrFrom = new WithOrFrom(withOrFromArray.get(i).isString().stringValue()); + WithOrFrom withOrFrom ; + if(withOrFromArray.get(i).isString()!=null){ + withOrFrom = new WithOrFrom(withOrFromArray.get(i).isString().stringValue()); + } + else{ + withOrFrom = new WithOrFrom("Value is an error, please edit or delete: "+withOrFromArray.get(i)); + } withOrFromList.add(withOrFrom); } } diff --git a/src/gwt/org/bbop/apollo/gwt/client/dto/ProvenanceConverter.java b/src/gwt/org/bbop/apollo/gwt/client/dto/ProvenanceConverter.java index 644720f981..a6b01e06be 100644 --- a/src/gwt/org/bbop/apollo/gwt/client/dto/ProvenanceConverter.java +++ b/src/gwt/org/bbop/apollo/gwt/client/dto/ProvenanceConverter.java @@ -45,7 +45,13 @@ public static Provenance convertFromJson(JSONObject object) { String withOrFromString = object.get("withOrFrom").isString().stringValue(); JSONArray withOrFromArray = JSONParser.parseLenient(withOrFromString).isArray(); for (int i = 0; i < withOrFromArray.size(); i++) { - WithOrFrom withOrFrom = new WithOrFrom(withOrFromArray.get(i).isString().stringValue()); + WithOrFrom withOrFrom ; + if(withOrFromArray.get(i).isString()!=null){ + withOrFrom = new WithOrFrom(withOrFromArray.get(i).isString().stringValue()); + } + else{ + withOrFrom = new WithOrFrom("Value is an error, please edit or delete: "+withOrFromArray.get(i)); + } withOrFromList.add(withOrFrom); } }