Permalink
Browse files

Added fix for user registered date null pointer

  • Loading branch information...
wheavin authored and jkovacs committed Aug 30, 2017
1 parent acf212d commit 2cc381683ceae99606b9becdaffc6727e2dcd561
Showing with 6 additions and 1 deletion.
  1. +1 −0 .gitignore
  2. +5 −1 src/main/java/de/umass/lastfm/User.java
View
1 .gitignore 100644 → 100755
@@ -3,5 +3,6 @@
*.iml
*.iws
*.ipr
.idea/
target
View
@@ -637,7 +637,11 @@ public User createItemFromElement(DomElement element) {
}
if (element.hasChild("registered")) {
String unixtime = element.getChild("registered").getAttribute("unixtime");
user.registeredDate = new Date(Long.parseLong(unixtime) * 1000);
try {
user.registeredDate = new Date(Long.parseLong(unixtime) * 1000);
} catch (NumberFormatException e) {
// no registered date
}
}
return user;
}

0 comments on commit 2cc3816

Please sign in to comment.