Pārlūkot izejas kodu

修复变更读取期问题

laiguoran 3 gadi atpakaļ
vecāks
revīzija
d8c17bb7ad
1 mainītis faili ar 3 papildinājumiem un 0 dzēšanām
  1. 3 0
      app/service/stage_change.js

+ 3 - 0
app/service/stage_change.js

@@ -309,6 +309,9 @@ module.exports = app => {
 
         async getFinalUsedData(tid, cid) {
             const stage = await this.ctx.service.stage.getLastestStage(tid, true);
+            if (!stage) { // 防止未创建期时调用
+                return [];
+            }
             if (stage.status === audit.stage.status.checked) {
                 const sql = 'SELECT scf.* ' +
                     '  FROM ' + this.ctx.service.stageChangeFinal.tableName + ' scf ' +