From: Bartek Przybylski Date: Sun, 24 Jun 2012 11:18:07 +0000 (+0200) Subject: dont crash when file has unspecified type X-Git-Tag: oc-android-1.4.3~344 X-Git-Url: http://git.linex4red.de/pub/Android/ownCloud.git/commitdiff_plain/f6ef3f8214feed4267ea91f5e719f174f40423ca?ds=inline dont crash when file has unspecified type --- diff --git a/src/eu/alefzero/owncloud/DisplayUtils.java b/src/eu/alefzero/owncloud/DisplayUtils.java index bf86c6f9..3e9f778e 100644 --- a/src/eu/alefzero/owncloud/DisplayUtils.java +++ b/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"; } /**