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