Commit 70a563e4 by NGUYEN HOANG SON

fix bug crash with cmd "updateTaskReport" when currentTaskDto is null

parent 15db22bf
...@@ -5415,7 +5415,9 @@ public class ContentViewActivity extends ABVContentViewActivity { ...@@ -5415,7 +5415,9 @@ public class ContentViewActivity extends ABVContentViewActivity {
JSONObject hotspot = null; JSONObject hotspot = null;
if (checkParam.get(ABookKeys.HOT_SPOT) != null) { if (checkParam.get(ABookKeys.HOT_SPOT) != null) {
hotspot = new JSONObject(checkParam.get(ABookKeys.HOT_SPOT)); hotspot = new JSONObject(checkParam.get(ABookKeys.HOT_SPOT));
taskCode = hotspot.getString(ABookKeys.TASK_CODE); if (hotspot.has(ABookKeys.TASK_CODE)) {
taskCode = hotspot.getString(ABookKeys.TASK_CODE);
}
} }
OperationDto operation = mOperationDao.getOperation(mOperationId); OperationDto operation = mOperationDao.getOperation(mOperationId);
String jsonPath = ""; String jsonPath = "";
...@@ -5426,8 +5428,10 @@ public class ContentViewActivity extends ABVContentViewActivity { ...@@ -5426,8 +5428,10 @@ public class ContentViewActivity extends ABVContentViewActivity {
for (TaskDto task : taskList) { for (TaskDto task : taskList) {
if (task.phaseNo == 1) { if (task.phaseNo == 1) {
operationTaskLayout.setIconStatus(taskKey, true); operationTaskLayout.setIconStatus(taskKey, true);
operationTaskLayout.currentTaskDto.taskKey = task.taskKey; if (operationTaskLayout.currentTaskDto != null) {
operationTaskLayout.currentTaskDto.taskCode = task.taskCode; operationTaskLayout.currentTaskDto.taskKey = task.taskKey;
operationTaskLayout.currentTaskDto.taskCode = task.taskCode;
}
jsonPath = mContentPath.replaceAll(ABookKeys.PANO_IMAGE,ABookKeys.PROCESS_LIST).replaceAll(ABookKeys.TASK_PDF, ABookKeys.PROCESS_LIST) + "/" + ABookKeys.PHASE_INFO_JSON; jsonPath = mContentPath.replaceAll(ABookKeys.PANO_IMAGE,ABookKeys.PROCESS_LIST).replaceAll(ABookKeys.TASK_PDF, ABookKeys.PROCESS_LIST) + "/" + ABookKeys.PHASE_INFO_JSON;
JSONObject phaseInfo = null; JSONObject phaseInfo = null;
int lastPhase = 0; int lastPhase = 0;
...@@ -5451,14 +5455,16 @@ public class ContentViewActivity extends ABVContentViewActivity { ...@@ -5451,14 +5455,16 @@ public class ContentViewActivity extends ABVContentViewActivity {
lastTask = compareTask; lastTask = compareTask;
} }
} }
if (lastTask != null) { if (operationTaskLayout.currentTaskDto != null) {
operationTaskLayout.currentTaskDto.isFinished = (lastTask.taskStatus == FINISHED_STATUS); if (lastTask != null) {
} else { operationTaskLayout.currentTaskDto.isFinished = (lastTask.taskStatus == FINISHED_STATUS);
operationTaskLayout.currentTaskDto.isFinished = false; } else {
operationTaskLayout.currentTaskDto.isFinished = false;
}
operationTaskLayout.currentTaskDto.processKey = task.processKey;
operationTaskLayout.currentTaskDto.processStatus = task.processStatus;
operationTaskLayout.addOperationTaskIcon(operationTaskLayout.currentLayout, operationTaskLayout.currentTaskDto);
} }
operationTaskLayout.currentTaskDto.processKey = task.processKey;
operationTaskLayout.currentTaskDto.processStatus = task.processStatus;
operationTaskLayout.addOperationTaskIcon(operationTaskLayout.currentLayout, operationTaskLayout.currentTaskDto);
} }
} }
} else { } else {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment