diff --git a/module/story/control.php b/module/story/control.php index ba68c84bc6..e2dd3b4a69 100755 --- a/module/story/control.php +++ b/module/story/control.php @@ -1328,7 +1328,7 @@ class story extends control $this->story->linkStories($storyID, $this->post->stories); if(dao::isError()) return $this->send(array('result' => 'fail', 'message' => dao::getError())); - return $this->send(array('result' => 'success', 'callback' => "const modal = zui.Modal.query('.modal-dialog[data-auto-load=\"story:$storyID\"]'); if(modal) modal.render(); else loadCurrentPage();", 'closeModal' => true)); + return $this->send(array('result' => 'success', 'callback' => "const modal = zui.Modal.query('.modal-dialog[data-auto-load=\"story:$storyID\"]'); if(typeof(modal) !== 'undefined') modal.render(); else loadCurrentPage();", 'closeModal' => true)); } /* Get story, product, products, and queryID. */