fix null pointer dereference in class Claim
releaseTimeString can be initialized to null. Check for this case before trying to parse it.
This commit is contained in:
parent
1e3a74cae1
commit
8d8d4a99c1
1 changed files with 6 additions and 4 deletions
|
@ -384,11 +384,13 @@ public class Claim {
|
|||
long feeAmount = searchResultObject.isNull("fee") ? 0 : searchResultObject.getLong("fee");
|
||||
String releaseTimeString = !searchResultObject.isNull("release_time") ? searchResultObject.getString("release_time") : null;
|
||||
long releaseTime = 0;
|
||||
if (releaseTimeString != null) {
|
||||
try {
|
||||
releaseTime = Double.valueOf(new SimpleDateFormat(RELEASE_TIME_DATE_FORMAT).parse(releaseTimeString).getTime() / 1000.0).longValue();
|
||||
} catch (ParseException ex) {
|
||||
// pass
|
||||
}
|
||||
}
|
||||
|
||||
GenericMetadata metadata = (duration > 0 || releaseTime > 0 || feeAmount > 0) ? new StreamMetadata() : new GenericMetadata();
|
||||
metadata.setTitle(searchResultObject.getString("title"));
|
||||
|
|
Loading…
Reference in a new issue