diff --git a/frontend/server/api/champions.ts b/frontend/server/api/champions.ts index ad0645e..4dfc31c 100644 --- a/frontend/server/api/champions.ts +++ b/frontend/server/api/champions.ts @@ -6,9 +6,11 @@ async function champions(client: MongoClient, patch: string) { const collection = database.collection(patch); const data : Array = (await collection.find().toArray()) as unknown as Array data.map((x) => { - for(let lane of x.lanes) { - delete lane.builds - delete lane.runes + if(x.lanes != undefined && x.lanes != null) { + for(let lane of x.lanes) { + delete lane.builds + delete lane.runes + } } }) return data