From 3414ec11139e6fd6e49c24699d857515284cbe61 Mon Sep 17 00:00:00 2001 From: "E. S." Date: Fri, 15 Mar 2024 17:36:34 +0000 Subject: [PATCH] fix --- lib/posts.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/posts.php b/lib/posts.php index 9a3c4eb..462168e 100644 --- a/lib/posts.php +++ b/lib/posts.php @@ -209,7 +209,11 @@ class PostText extends model { $images_affected = 0; $uploads = uploads::getUploadsByRandomId(array_keys($images), true); - foreach ($uploads as $u) { + foreach ($uploads as $upload_key => $u) { + if ($u === null) { + logError(__METHOD__.': upload '.$upload_key.' is null'); + continue; + } foreach ($images[$u->randomId] as $s) { list($w, $h) = $s; list($w, $h) = $u->getImagePreviewSize($w, $h);