diff options
author | iNPUTmice <daniel@gultsch.de> | 2014-10-27 21:47:17 +0100 |
---|---|---|
committer | iNPUTmice <daniel@gultsch.de> | 2014-10-27 21:47:17 +0100 |
commit | f45a841caff20692586e19933ed1571d3e6cbf21 (patch) | |
tree | 1f3fef4a829c0992a3f78ecefa3e830a8196688d /src/eu | |
parent | da822ebae89ad3b010a58cdf3b812d26de4b2aa4 (diff) |
fixed url parsing
Diffstat (limited to 'src/eu')
-rw-r--r-- | src/eu/siacs/conversations/entities/Message.java | 7 |
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( |