Explorar o código

修复变更读取期问题

laiguoran %!s(int64=3) %!d(string=hai) anos
pai
achega
d8c17bb7ad
Modificáronse 1 ficheiros con 3 adicións e 0 borrados
  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 ' +