Răsfoiți Sursa

dont crash when file has unspecified type

Bartek Przybylski 13 ani în urmă
părinte
comite
f6ef3f8214
1 a modificat fișierele cu 3 adăugiri și 1 ștergeri
  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";
     }
 
     /**