Explorar el Código

fixing an unhandled case found with scrutinizer-ci

El RIDO hace 10 años
padre
commit
b8080acc78
Se han modificado 2 ficheros con 4 adiciones y 2 borrados
  1. 1 1
      lib/model/comment.php
  2. 3 1
      lib/model/paste.php

+ 1 - 1
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()
     {

+ 3 - 1
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'))
         {