openvidu-server: fix old recordings compatibility with 2.17.0 release

pull/621/head
pabloFuente 2021-03-11 12:46:44 +01:00
parent 7184bd4e9a
commit 5b3dca2907
1 changed files with 4 additions and 2 deletions

View File

@ -58,7 +58,9 @@ public class Recording {
public Recording(JsonObject json) { public Recording(JsonObject json) {
this.id = json.get("id").getAsString(); this.id = json.get("id").getAsString();
this.sessionId = json.get("sessionId").getAsString(); this.sessionId = json.get("sessionId").getAsString();
this.uniqueSessionId = json.get("uniqueSessionId").getAsString(); if (json.has("uniqueSessionId")) {
this.uniqueSessionId = json.get("uniqueSessionId").getAsString();
}
this.createdAt = json.get("createdAt").getAsLong(); this.createdAt = json.get("createdAt").getAsLong();
this.size = json.get("size").getAsLong(); this.size = json.get("size").getAsLong();
try { try {
@ -205,7 +207,7 @@ public class Recording {
} }
} }
json.addProperty("sessionId", this.sessionId); json.addProperty("sessionId", this.sessionId);
if (withUniqueSessionId) { if (withUniqueSessionId && this.uniqueSessionId != null) {
json.addProperty("uniqueSessionId", this.uniqueSessionId); json.addProperty("uniqueSessionId", this.uniqueSessionId);
} }
if (this.recordingProperties.mediaNode() != null) { if (this.recordingProperties.mediaNode() != null) {