From b8080acc782204f5f0b5b5ac8e7a085365a78447 Mon Sep 17 00:00:00 2001 From: El RIDO Date: Wed, 6 Jul 2016 14:58:06 +0200 Subject: [PATCH] fixing an unhandled case found with scrutinizer-ci --- lib/model/comment.php | 2 +- lib/model/paste.php | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/model/comment.php b/lib/model/comment.php index 1c09533..11d4558 100644 --- a/lib/model/comment.php +++ b/lib/model/comment.php @@ -30,7 +30,7 @@ class model_comment extends model_abstract * * @access public * @throws Exception - * @return stdObject + * @return stdClass */ public function get() { diff --git a/lib/model/paste.php b/lib/model/paste.php index 1aadfbc..090f126 100644 --- a/lib/model/paste.php +++ b/lib/model/paste.php @@ -22,11 +22,13 @@ class model_paste extends model_abstract * * @access public * @throws Exception - * @return stdObject + * @return stdClass */ public function get() { $this->_data = $this->_store->read($this->getId()); + if ($this->_data === false) throw new Exception(zerobin::GENERIC_ERROR, 64); + // check if paste has expired and delete it if neccessary. if (property_exists($this->_data->meta, 'expire_date')) {