@@ -62,7 +62,7 @@ public class ModelAI {
}
protected JSONObject loadEntity(JSONObject jsonObject, String entityRelationObject, String outputs, String content) {
- if (jsonObject == null) {
+ if (jsonObject == null || null == jsonObject.getJSONObject(entityRelationObject)) {
return new JSONObject();
JSONObject aiOut = jsonObject.getJSONObject(entityRelationObject).getJSONObject(outputs);
@@ -160,7 +160,7 @@ public class ThreeLevelWardAI extends ModelAI {
*/
public void putWardRoundCrfData(JSONObject jsonObject, InputInfo inputInfo, int serious) {
JSONObject aiOut = loadEntity(jsonObject, entityRelationObject, outputs, content);
- if (aiOut == null) {
+ if (aiOut == null || aiOut.size() == 0) {
return;
String wardDate = jsonObject.getString("wardDate");