瀏覽代碼

dont crash when file has unspecified type

Bartek Przybylski 13 年之前
父節點
當前提交
f6ef3f8214
共有 1 個文件被更改,包括 3 次插入1 次删除
  1. 3 1
      src/eu/alefzero/owncloud/DisplayUtils.java

+ 3 - 1
src/eu/alefzero/owncloud/DisplayUtils.java

@@ -100,7 +100,9 @@ public class DisplayUtils {
         if (mimeType2HUmanReadable.containsKey(mimetype)) {
             return mimeType2HUmanReadable.get(mimetype);
         }
-        return mimetype.split("/")[1].toUpperCase() + " file";
+        if (mimetype.split("/").length >= 2)
+            return mimetype.split("/")[1].toUpperCase() + " file";
+        return "Unknown type";
     }
 
     /**