From 5ba2cb07eabb5d2e02d959d454804b4c295fda3e Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Wed, 5 Jun 2013 16:11:51 -0400 Subject: [PATCH] Better handling of null values in ActivityObject::mimeTypeToObjectType --- lib/activityobject.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/activityobject.php b/lib/activityobject.php index 1a81d30687..7e9ddf48af 100644 --- a/lib/activityobject.php +++ b/lib/activityobject.php @@ -896,6 +896,13 @@ class ActivityObject static function mimeTypeToObjectType($mimeType) { $ot = null; + + // Default + + if (empty($mimeType)) { + return self::FILE; + } + $parts = explode('/', $mimeType); switch ($parts[0]) {