mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-23 11:39:50 +02:00
fix: all commands now work with a lack of tankopedia entries
This commit is contained in:
1 parent
f907c79d68
commit
ca208e44a1
12 files changed
+59
-26
No files matched your search
@@ -1,6 +1,6 @@
|
||||
import { tankopedia } from './tankopedia.js';
|
||||
|
||||
export default async function resolveTankName(tankId: number) {
|
||||
const tankopediaName = (await tankopedia)[tankId].name;
|
||||
const tankopediaName = (await tankopedia)[tankId]?.name;
|
||||
return tankopediaName ? tankopediaName : `Unknown Tank ${tankId}`;
|
||||
}
|
||||
@@ -13,7 +13,7 @@ export interface TankopediaEntry {
|
||||
}
|
||||
|
||||
export interface Tankopedia {
|
||||
[id: number]: TankopediaEntry;
|
||||
[id: number]: TankopediaEntry | undefined;
|
||||
}
|
||||
|
||||
console.log('Caching tankopedia...');
|
||||
|
||||
Reference in new issue
Block a user