Fixed bug when turning tablet with no file in the right fragment
[pub/Android/ownCloud.git] / src / com / owncloud / android / DisplayUtils.java
index 12b615e..70d5328 100644 (file)
@@ -3,9 +3,8 @@
  *   Copyright (C) 2012-2013 ownCloud Inc.\r
  *\r
  *   This program is free software: you can redistribute it and/or modify\r
- *   it under the terms of the GNU General Public License as published by\r
- *   the Free Software Foundation, either version 2 of the License, or\r
- *   (at your option) any later version.\r
+ *   it under the terms of the GNU General Public License version 2,\r
+ *   as published by the Free Software Foundation.\r
  *\r
  *   This program is distributed in the hope that it will be useful,\r
  *   but WITHOUT ANY WARRANTY; without even the implied warranty of\r
@@ -145,7 +144,7 @@ public class DisplayUtils {
         } else {\r
             String [] parts = mimetype.split("/");\r
             String type = parts[0];\r
-            String subtype = parts[1];\r
+            String subtype = (parts.length > 1) ? parts[1] : "";\r
             \r
             if(TYPE_TXT.equals(type)) {\r
                 return R.drawable.file_doc;\r