fix error message with wrong reviver, refactor part of player

This commit is contained in:
Olivier Gagnon
2021-10-11 23:14:15 -04:00
parent 56c8a23631
commit 78d9c25671
7 changed files with 43 additions and 31 deletions
+1 -2
View File
@@ -12,8 +12,7 @@ export interface IReviverValue {
// off to that `fromJSON` fuunction, passing in the value.
export function Reviver(key: string, value: IReviverValue | null): any {
if (value == null) {
console.log("Reviver WRONGLY called with key: " + key + ", and value: " + value);
return 0;
return null;
}
if (typeof value === "object" && typeof value.ctor === "string" && typeof value.data !== "undefined") {