handle the empty user metadata
This commit is contained in:
parent
cbc9929b92
commit
51691fc06d
@ -76,10 +76,12 @@ public class GetAllProjectMetadataCommand extends Command {
|
|||||||
}
|
}
|
||||||
writer.endObject();
|
writer.endObject();
|
||||||
|
|
||||||
|
String userMeta = (String)ProjectManager.singleton.getPreferenceStore().get("userMetaData");
|
||||||
|
if (userMeta != null) {
|
||||||
writer.key("customMetaDataColumns");
|
writer.key("customMetaDataColumns");
|
||||||
JSONArray customMetaDataColumns = new JSONArray(
|
JSONArray customMetaDataColumns = new JSONArray(userMeta);
|
||||||
(String)ProjectManager.singleton.getPreferenceStore().get("userMetaData"));
|
|
||||||
writer.value(customMetaDataColumns);
|
writer.value(customMetaDataColumns);
|
||||||
|
}
|
||||||
|
|
||||||
writer.endObject();
|
writer.endObject();
|
||||||
} catch (JSONException e) {
|
} catch (JSONException e) {
|
||||||
|
@ -413,7 +413,10 @@ public class FileProjectManager extends ProjectManager {
|
|||||||
JSONArray jsonObjArray = metadata.getUserMetadata();
|
JSONArray jsonObjArray = metadata.getUserMetadata();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
userMetadataPreference = new JSONArray((String)_preferenceStore.get(PreferenceStore.USER_METADATA_KEY));
|
String userMeta = (String)_preferenceStore.get(PreferenceStore.USER_METADATA_KEY);
|
||||||
|
if (userMeta == null)
|
||||||
|
return;
|
||||||
|
userMetadataPreference = new JSONArray(userMeta);
|
||||||
} catch (JSONException e1) {
|
} catch (JSONException e1) {
|
||||||
logger.error(ExceptionUtils.getFullStackTrace(e1));
|
logger.error(ExceptionUtils.getFullStackTrace(e1));
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user