aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorScott Jackson <daneren2005@gmail.com>2016-06-08 17:36:45 -0700
committerScott Jackson <daneren2005@gmail.com>2016-06-08 17:36:45 -0700
commit9fac439fd85487a165132431f4af74507218332e (patch)
tree2f1265d492b445c97bebb1ba5aba7c331885e39d
parent5dd1537844ffd459adeefec1bda88d6c6234e068 (diff)
downloaddsub-9fac439fd85487a165132431f4af74507218332e.tar.gz
dsub-9fac439fd85487a165132431f4af74507218332e.tar.bz2
dsub-9fac439fd85487a165132431f4af74507218332e.zip
Fix crash if formatting null date string
-rw-r--r--app/src/main/java/github/daneren2005/dsub/util/Util.java4
1 files changed, 4 insertions, 0 deletions
diff --git a/app/src/main/java/github/daneren2005/dsub/util/Util.java b/app/src/main/java/github/daneren2005/dsub/util/Util.java
index c3f1a086..417c3173 100644
--- a/app/src/main/java/github/daneren2005/dsub/util/Util.java
+++ b/app/src/main/java/github/daneren2005/dsub/util/Util.java
@@ -919,6 +919,10 @@ public final class Util {
return formatDate(context, dateString, true);
}
public static String formatDate(Context context, String dateString, boolean includeTime) {
+ if(dateString == null) {
+ return "";
+ }
+
try {
dateString = dateString.replace(' ', 'T');
boolean isDateNormalized = ServerInfo.checkServerVersion(context, "1.11");