feat: null handling

This commit is contained in:
TrèsAbhi committed 2024-04-16 13:45:03 -05:00
1 parent 3e7a73c528
commit 7aa0b65d1d
6 files changed
+41 -19

No files matched your search

+5 -1
View File
@@ -126,7 +126,11 @@ export const researchCommand = new Promise<CommandRegistry>((resolve) => {
]);
}
const tankStats = await getTankStats(region, id, interaction.locale);
const tankStats = await getTankStats(region, id);
if (tankStats === null) {
return t`bot.common.errors.no_tank_stats`;
}
if (tankStats.some(({ tank_id }) => tank_id === targetTankId)) {
return translate('bot.commands.research.errors.already_researched', [