作者 linmadan

修复申请完成任务bug

@@ -45,7 +45,7 @@ func (service *ApplyCompleteTaskService) ApplyComplete(taskId int64, receiverUid @@ -45,7 +45,7 @@ func (service *ApplyCompleteTaskService) ApplyComplete(taskId int64, receiverUid
45 return nil, fmt.Errorf("无效的任务") 45 return nil, fmt.Errorf("无效的任务")
46 } 46 }
47 if task.TaskType == domain.TASK_TYPE_ROB { 47 if task.TaskType == domain.TASK_TYPE_ROB {
48 - if task.RobInfo.Receiver != nil { 48 + if task.RobInfo != nil && task.RobInfo.Receiver != nil {
49 if receiver.EmployeeInfo.Uid != task.RobInfo.Receiver.Uid { 49 if receiver.EmployeeInfo.Uid != task.RobInfo.Receiver.Uid {
50 return nil, fmt.Errorf("无法申请完成别人领取的任务") 50 return nil, fmt.Errorf("无法申请完成别人领取的任务")
51 } 51 }
@@ -54,7 +54,7 @@ func (service *ApplyCompleteTaskService) ApplyComplete(taskId int64, receiverUid @@ -54,7 +54,7 @@ func (service *ApplyCompleteTaskService) ApplyComplete(taskId int64, receiverUid
54 } 54 }
55 } 55 }
56 if task.TaskType == domain.TASK_TYPE_BID { 56 if task.TaskType == domain.TASK_TYPE_BID {
57 - if task.BidInfo.SuccessfulBidder != nil { 57 + if task.BidInfo != nil && task.BidInfo.SuccessfulBidder != nil {
58 if receiver.EmployeeInfo.Uid != task.BidInfo.SuccessfulBidder.Uid { 58 if receiver.EmployeeInfo.Uid != task.BidInfo.SuccessfulBidder.Uid {
59 return nil, fmt.Errorf("无法申请完成别人领取的任务") 59 return nil, fmt.Errorf("无法申请完成别人领取的任务")
60 } 60 }