diff --git a/include/dokument.class.php b/include/dokument.class.php index 361599382..d4356be85 100644 --- a/include/dokument.class.php +++ b/include/dokument.class.php @@ -832,16 +832,21 @@ class dokument extends basis_db if($result = $this->db_query($qry)) { - $stg_obj = new basis_db(); - while($row = $this->db_fetch_object($result)) + if ($this->db_num_rows($result) > 0) { - $stg_obj->kuerzel = $row->kuerzel; - $stg_obj->bezeichnung = $row->bezeichnung; - $stg_obj->studiengang_kz = $row->studiengang_kz; - - $this->result[] = $stg_obj; + while($row = $this->db_fetch_object($result)) + { + $stg_obj = new basis_db(); + $stg_obj->kuerzel = $row->kuerzel; + $stg_obj->bezeichnung = $row->bezeichnung; + $stg_obj->studiengang_kz = $row->studiengang_kz; + + $this->result[] = $stg_obj; + } + return $stg_obj; } - return $stg_obj; + else + return false; } else {