viewgit/inc/functions.php:22 Function utf8_encode() is deprecated [8192]

Fix error message caused when group_id is empty in getGroupById

Chris Pollett [2023-09-14 02:Sep:th]
Fix error message caused when group_id is empty in getGroupById
Filename
src/models/GroupModel.php
diff --git a/src/models/GroupModel.php b/src/models/GroupModel.php
index 486338092..19e411296 100644
--- a/src/models/GroupModel.php
+++ b/src/models/GroupModel.php
@@ -509,6 +509,9 @@ class GroupModel extends Model implements MediaConstants
         $require_root_or_member = false)
     {
         $db = $this->db;
+        if (empty($group_id)) {
+            return false;
+        }
         if (!is_numeric($user_id)) { //Postgres strict about types so being safe
             $user_id = C\PUBLIC_USER_ID;
         }
ViewGit