Commit 70a563e4 by NGUYEN HOANG SON

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

parent 15db22bf
......@@ -5415,8 +5415,10 @@ public class ContentViewActivity extends ABVContentViewActivity {
JSONObject hotspot = null;
if (checkParam.get(ABookKeys.HOT_SPOT) != null) {
hotspot = new JSONObject(checkParam.get(ABookKeys.HOT_SPOT));
if (hotspot.has(ABookKeys.TASK_CODE)) {
taskCode = hotspot.getString(ABookKeys.TASK_CODE);
}
}
OperationDto operation = mOperationDao.getOperation(mOperationId);
String jsonPath = "";
if ((operation.operationType == PANO || operation.operationType == DRAWING || operation.operationType == PDF) && operation.reportType == Constant.ReportType.ReportContinuous) {
......@@ -5426,8 +5428,10 @@ public class ContentViewActivity extends ABVContentViewActivity {
for (TaskDto task : taskList) {
if (task.phaseNo == 1) {
operationTaskLayout.setIconStatus(taskKey, true);
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,6 +5455,7 @@ public class ContentViewActivity extends ABVContentViewActivity {
lastTask = compareTask;
}
}
if (operationTaskLayout.currentTaskDto != null) {
if (lastTask != null) {
operationTaskLayout.currentTaskDto.isFinished = (lastTask.taskStatus == FINISHED_STATUS);
} else {
......@@ -5461,6 +5466,7 @@ public class ContentViewActivity extends ABVContentViewActivity {
operationTaskLayout.addOperationTaskIcon(operationTaskLayout.currentLayout, operationTaskLayout.currentTaskDto);
}
}
}
} else {
operationTaskLayout.setIconStatus(taskKey, true);
if (operationTaskLayout.currentTaskDto != null) {
......
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