Skip to content

Commit

Permalink
bail if alphabet is already longer than max
Browse files Browse the repository at this point in the history
  • Loading branch information
jtbandes committed Dec 19, 2024
1 parent f28dee5 commit 08f2e3f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/FontManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,10 @@ export class FontManager extends EventDispatcher<EventMap> {
}

update(newChars: string): void {
if (this.alphabet.length > MAX_CHARS) {
// we would have already reported an error; just bail this time
return;
}
let needsUpdate = false;
for (const char of newChars) {
if (!this.alphabet.includes(char)) {
Expand Down

0 comments on commit 08f2e3f

Please sign in to comment.