Commit 7f931545 authored by nanahira's avatar nanahira

fix

parent 8f62bc29
Pipeline #41216 passed with stages
in 44 seconds
...@@ -65,6 +65,13 @@ export class CardDataService { ...@@ -65,6 +65,13 @@ export class CardDataService {
).toException(); ).toException();
} }
const data = this.parseYgoCardType(resp); const data = this.parseYgoCardType(resp);
if (!data) {
this.logger.warn(`Card ID ${id} has invalid data`);
throw new GenericReturnMessageDto(
404,
`Card ID ${id} has invalid data`,
).toException();
}
this.logger.log( this.logger.log(
`Fetched card data for ID ${id}: ${data.type} ${data.name}`, `Fetched card data for ID ${id}: ${data.type} ${data.name}`,
); );
...@@ -84,6 +91,7 @@ export class CardDataService { ...@@ -84,6 +91,7 @@ export class CardDataService {
this.ygocdbExisting.clear(); this.ygocdbExisting.clear();
for (const card of cards) { for (const card of cards) {
const data = this.parseYgoCardType(card); const data = this.parseYgoCardType(card);
if (!data) continue;
this.ygocdbExisting.set(card.id, data); this.ygocdbExisting.set(card.id, data);
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment