openvidu-java-client: protect "duration" property from long value

pull/73/head
pabloFuente 2018-05-10 12:36:56 +02:00
parent 24279cb337
commit eed1ed6c63
1 changed files with 5 additions and 1 deletions

View File

@ -58,7 +58,11 @@ public class Recording {
this.sessionId = (String) json.get("sessionId");
this.createdAt = (long) json.get("createdAt");
this.size = (long) json.get("size");
this.duration = (double) json.get("duration");
try {
this.duration = (double) json.get("duration");
} catch (Exception e) {
this.duration = new Long((long) json.get("duration")).doubleValue();
}
this.url = (String) json.get("url");
this.hasAudio = (boolean) json.get("hasAudio");
this.hasVideo = (boolean) json.get("hasVideo");