From e7bec99dc706e6f7dd1fb472f6d2625526cd4546 Mon Sep 17 00:00:00 2001 From: qiyu-xie Date: Fri, 2 Jul 2021 14:30:48 +0800 Subject: [PATCH] * Fix a bug when import story from library. --- module/story/model.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/module/story/model.php b/module/story/model.php index 8cafbe1568..7c1004138a 100644 --- a/module/story/model.php +++ b/module/story/model.php @@ -3211,8 +3211,8 @@ class storyModel extends model */ public function getSubject($story) { - $productName = $this->loadModel('product')->getById($story->product)->name; - return 'STORY #' . $story->id . ' ' . $story->title . ' - ' . $productName; + $productName = empty($story->product) ? '' : ' - ' . $this->loadModel('product')->getById($story->product)->name; + return 'STORY #' . $story->id . ' ' . $story->title . $productName; } /**