diff --git a/src/applications/files/storage/PhabricatorFile.php b/src/applications/files/storage/PhabricatorFile.php --- a/src/applications/files/storage/PhabricatorFile.php +++ b/src/applications/files/storage/PhabricatorFile.php @@ -971,10 +971,13 @@ // warns you if you don't have complete support. $matches = null; - $ok = preg_match( - '@^image/(gif|png|jpe?g)@', - $this->getViewableMimeType(), - $matches); + $ok = false; + if ($this->getViewableMimeType() !== null) { + $ok = preg_match( + '@^image/(gif|png|jpe?g)@', + $this->getViewableMimeType(), + $matches); + } if (!$ok) { return false; }