]> git.mxchange.org Git - friendica.git/commitdiff
Fix notices
authorMichael <heluecht@pirati.ca>
Sat, 10 Apr 2021 16:19:22 +0000 (16:19 +0000)
committerMichael <heluecht@pirati.ca>
Sat, 10 Apr 2021 16:19:22 +0000 (16:19 +0000)
See https://github.com/friendica/friendica/issues/9749#issuecomment-774666356
and https://github.com/friendica/friendica/issues/9747#issuecomment-785262156

mod/display.php
src/Module/Conversation/Community.php

index 89dc340a434c1645b6e775b7d577c1951a0fd336..2750102d7b4ea10f4af6b7cb4e9c4392ac7a47aa 100644 (file)
@@ -188,12 +188,14 @@ function display_content(App $a, $update = false, $update_uid = 0)
        if ($update) {
                $uri_id = $_REQUEST['uri_id'];
                $item = Post::selectFirst(['uid', 'parent-uri-id'], ['uri-id' => $uri_id, 'uid' => $update_uid]);
-               if ($item['uid'] != 0) {
-                       $a->profile = ['uid' => intval($item['uid'])];
-               } else {
-                       $a->profile = ['uid' => intval($update_uid)];
+               if (!empty($item)) {
+                       if ($item['uid'] != 0) {
+                               $a->profile = ['uid' => intval($item['uid'])];
+                       } else {
+                               $a->profile = ['uid' => intval($update_uid)];
+                       }
+                       $parent_uri_id = $item['parent-uri-id'];
                }
-               $parent_uri_id = $item['parent-uri-id'];
        } else {
                $uri_id = (($a->argc > 2) ? $a->argv[2] : 0);
                $parent_uri_id = $uri_id;
index 329f38e3b52239f2dd5c5e27c089b70f3ae5dc2a..18332fe27e4cf1f5c4f20cee45e1aca654e74007 100644 (file)
@@ -359,6 +359,9 @@ class Community extends BaseModule
                $r = Post::selectThreadForUser(0, ['uri-id', 'commented', 'author-link'], $condition, $params);
 
                $items = Post::toArray($r);
+               if (empty($items)) {
+                       return [];
+               }
 
                // Previous page case: once we get the relevant items closest to min_id, we need to restore the expected display order
                if (empty($item_id) && isset($min_id) && !isset($max_id)) {