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 {
JSONObject hotspot = null;
if (checkParam.get(ABookKeys.HOT_SPOT) != null) {
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);
String jsonPath = "";
......@@ -5426,8 +5428,10 @@ public class ContentViewActivity extends ABVContentViewActivity {
for (TaskDto task : taskList) {
if (task.phaseNo == 1) {
operationTaskLayout.setIconStatus(taskKey, true);
operationTaskLayout.currentTaskDto.taskKey = task.taskKey;
operationTaskLayout.currentTaskDto.taskCode = task.taskCode;
if (operationTaskLayout.currentTaskDto != null) {
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;
JSONObject phaseInfo = null;
int lastPhase = 0;
......@@ -5451,14 +5455,16 @@ public class ContentViewActivity extends ABVContentViewActivity {
lastTask = compareTask;
}
}
if (lastTask != null) {
operationTaskLayout.currentTaskDto.isFinished = (lastTask.taskStatus == FINISHED_STATUS);
} else {
operationTaskLayout.currentTaskDto.isFinished = false;
if (operationTaskLayout.currentTaskDto != null) {
if (lastTask != null) {
operationTaskLayout.currentTaskDto.isFinished = (lastTask.taskStatus == FINISHED_STATUS);
} 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 {
......
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