takeru0001 5 лет назад
Родитель
Сommit
040e239eac
1 измененных файлов с 9 добавлено и 7 удалено
  1. 9 7
      src/server/routes/apiv3/pages.js

+ 9 - 7
src/server/routes/apiv3/pages.js

@@ -407,14 +407,16 @@ module.exports = (crowi) => {
 
     const result = { page: pageService.serializeToObj(page) };
 
-    try {
+    if (globalNotificationService != null) {
+      try {
       // global notification
-      await globalNotificationService.fire(GlobalNotificationSetting.EVENT.PAGE_MOVE, page, req.user, {
-        oldPath: req.body.path,
-      });
-    }
-    catch (err) {
-      logger.error('Move notification failed', err);
+        await globalNotificationService.fire(GlobalNotificationSetting.EVENT.PAGE_MOVE, page, req.user, {
+          oldPath: req.body.path,
+        });
+      }
+      catch (err) {
+        logger.error('Move notification failed', err);
+      }
     }
 
     return res.apiv3(result);