From 2633b5c23cc6f9b1f2c754fba3c769df5697a7d0 Mon Sep 17 00:00:00 2001 From: zhengrunyu Date: Tue, 26 Apr 2022 15:14:22 +0800 Subject: [PATCH] * Fix bug when create task and story error. --- module/story/control.php | 2 +- module/task/control.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/module/story/control.php b/module/story/control.php index 0e6a275007..11d75168ca 100644 --- a/module/story/control.php +++ b/module/story/control.php @@ -978,7 +978,7 @@ class story extends control $version = $this->dao->findById($storyID)->from(TABLE_STORY)->fetch('version'); $files = $this->loadModel('file')->saveUpload($story->type, $storyID, $version); - if(empty($files) and $this->post->uid != '') $files = $this->file->getPairs($_SESSION['album']['used'][$this->post->uid]); + if(empty($files) and $this->post->uid != '' and isset($_SESSION['album']['used'][$this->post->uid])) $files = $this->file->getPairs($_SESSION['album']['used'][$this->post->uid]); if($this->post->comment != '' or !empty($changes) or !empty($files)) { diff --git a/module/task/control.php b/module/task/control.php index 8608103802..132f3f5f71 100644 --- a/module/task/control.php +++ b/module/task/control.php @@ -465,7 +465,7 @@ class task extends control $changes = $this->task->update($taskID); if(dao::isError()) return print(js::error(dao::getError())); $files = $this->loadModel('file')->saveUpload('task', $taskID); - if(empty($files) and $this->post->uid != '') $files = $this->file->getPairs($_SESSION['album']['used'][$this->post->uid]); + if(empty($files) and $this->post->uid != '' and isset($_SESSION['album']['used'][$this->post->uid])) $files = $this->file->getPairs($_SESSION['album']['used'][$this->post->uid]); } $task = $this->task->getById($taskID);