From de26b7f373559c54e0eaf236e2dc6818c07267bf Mon Sep 17 00:00:00 2001 From: Shish Date: Tue, 7 Jul 2020 16:07:19 +0000 Subject: [PATCH] don't die if database is missing a MIME type --- core/imageboard/image.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/core/imageboard/image.php b/core/imageboard/image.php index e4fa0c5d..9840e891 100644 --- a/core/imageboard/image.php +++ b/core/imageboard/image.php @@ -586,7 +586,11 @@ class Image if ($this->mime===MimeType::WEBP&&$this->lossless) { return MimeType::WEBP_LOSSLESS; } - return $this->mime; + $m = $this->mime; + if (is_null($m)) { + $m = MimeMap::get_for_extension($this->ext)[0]; + } + return $m; } /**