aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/eu
diff options
context:
space:
mode:
authorlookshe <github@lookshe.org>2016-03-12 15:04:07 +0100
committerlookshe <github@lookshe.org>2016-03-12 15:04:07 +0100
commit3dc635c6fdeae6024be3510c18821d6f9dc5b550 (patch)
treeb7e0911cafa681531da239bd2c38fb4a969cccf9 /src/main/java/eu
parente72f4091975838edf4ec6edf8b98c8214241a069 (diff)
small bugfixes
Diffstat (limited to 'src/main/java/eu')
-rw-r--r--src/main/java/eu/siacs/conversations/entities/Message.java3
-rw-r--r--src/main/java/eu/siacs/conversations/utils/FileUtils.java2
2 files changed, 4 insertions, 1 deletions
diff --git a/src/main/java/eu/siacs/conversations/entities/Message.java b/src/main/java/eu/siacs/conversations/entities/Message.java
index 12127ecc..184d7e56 100644
--- a/src/main/java/eu/siacs/conversations/entities/Message.java
+++ b/src/main/java/eu/siacs/conversations/entities/Message.java
@@ -470,6 +470,9 @@ public class Message extends AbstractEntity {
}
private String extractRelevantExtension(URL url) {
+ if (url == null) {
+ return null;
+ }
String path = url.getPath();
return extractRelevantExtension(path);
}
diff --git a/src/main/java/eu/siacs/conversations/utils/FileUtils.java b/src/main/java/eu/siacs/conversations/utils/FileUtils.java
index 727891ae..7c2a51c5 100644
--- a/src/main/java/eu/siacs/conversations/utils/FileUtils.java
+++ b/src/main/java/eu/siacs/conversations/utils/FileUtils.java
@@ -167,7 +167,7 @@ public class FileUtils {
final int lastDotPosition = filename.lastIndexOf('.');
final int secondToLastDotPosition = filename.lastIndexOf('.', lastDotPosition - 1);
final String secondToLastPart = secondToLastDotPosition != -1 ?
- filename.substring(secondToLastDotPosition + 1, lastDotPosition - 1) : "";
+ filename.substring(secondToLastDotPosition + 1, lastDotPosition) : "";
return secondToLastPart;
}
}