MaiXinRong 5 gadi atpakaļ
vecāks
revīzija
5281e9843c
1 mainītis faili ar 1 papildinājumiem un 1 dzēšanām
  1. 1 1
      app/service/stage.js

+ 1 - 1
app/service/stage.js

@@ -159,7 +159,7 @@ module.exports = app => {
             this.sqlBuilder.orderBy = [['order', 'desc']];
             const [sql, sqlParam] = this.sqlBuilder.build(this.tableName);
             const stage = await this.db.queryOne(sql, sqlParam);
-            stage.tp_history = stage.tp_history ? JSON.parse(stage.tp_history) : [];
+            if (stage) stage.tp_history = stage.tp_history ? JSON.parse(stage.tp_history) : [];
             return stage;
         }