diff --git a/lib/preview/unknown.php b/lib/preview/unknown.php
index 4e1ca7de7418c2669ce084331e05b3f4da56086f..a31b365722e665f4bd0682c1d49c8b6bd0ecbb4a 100644
--- a/lib/preview/unknown.php
+++ b/lib/preview/unknown.php
@@ -22,7 +22,11 @@ class Unknown extends Provider {
 
 		$iconsroot = \OC::$SERVERROOT . '/core/img/filetypes/';
 
-		$icons = array($mimetype, $type, 'text');
+		if(isset($type)){
+			$icons = array($mimetype, $type, 'text');
+		}else{
+			$icons = array($mimetype, 'text');
+		}
 		foreach($icons as $icon) {
 			$icon = str_replace('/', '-', $icon);