mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-01-18 23:11:11 +00:00
Fix error when importing data while eggs list is empty
This commit is contained in:
parent
1ad25bdf61
commit
183b53286e
@ -285,6 +285,8 @@ export class GameData {
|
|||||||
return JSON.parse(dataStr, (k: string, v: any) => {
|
return JSON.parse(dataStr, (k: string, v: any) => {
|
||||||
if (k === 'eggs') {
|
if (k === 'eggs') {
|
||||||
const ret: EggData[] = [];
|
const ret: EggData[] = [];
|
||||||
|
if (v === null)
|
||||||
|
v = [];
|
||||||
for (let e of v)
|
for (let e of v)
|
||||||
ret.push(new EggData(e));
|
ret.push(new EggData(e));
|
||||||
return ret;
|
return ret;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user