superdough: fallback to triangle when non-string is given

This commit is contained in:
Felix Roos
2025-05-02 08:54:34 +02:00
parent ffe831d24b
commit 7565354274
+4
View File
@@ -101,6 +101,10 @@ export async function aliasBank(...args) {
}
export function getSound(s) {
if (typeof s !== 'string') {
console.warn(`getSound: expected string got "${s}". fall back to triangle`);
return soundMap.get().triangle; // is this good?
}
return soundMap.get()[s.toLowerCase()];
}