aboutsummaryrefslogtreecommitdiffstats
path: root/src/eu/siacs
diff options
context:
space:
mode:
authoriNPUTmice <daniel@gultsch.de>2014-10-27 21:47:17 +0100
committeriNPUTmice <daniel@gultsch.de>2014-10-27 21:47:17 +0100
commitf45a841caff20692586e19933ed1571d3e6cbf21 (patch)
tree1f3fef4a829c0992a3f78ecefa3e830a8196688d /src/eu/siacs
parentda822ebae89ad3b010a58cdf3b812d26de4b2aa4 (diff)
fixed url parsing
Diffstat (limited to '')
-rw-r--r--src/eu/siacs/conversations/entities/Message.java7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/eu/siacs/conversations/entities/Message.java b/src/eu/siacs/conversations/entities/Message.java
index a089dd64..dd88c126 100644
--- a/src/eu/siacs/conversations/entities/Message.java
+++ b/src/eu/siacs/conversations/entities/Message.java
@@ -383,7 +383,12 @@ public class Message extends AbstractEntity {
return false;
}
String[] pathParts = url.getPath().split("/");
- String filename = pathParts[pathParts.length - 1];
+ String filename;
+ if (pathParts.length > 0) {
+ filename = pathParts[pathParts.length - 1];
+ } else {
+ filename = pathParts[0];
+ }
String[] extensionParts = filename.split("\\.");
if (extensionParts.length == 2
&& Arrays.asList(Downloadable.VALID_EXTENSIONS).contains(