mirror of
https://github.com/Equicord/Equicord.git
synced 2025-01-18 13:23:28 -05:00
Fix MLEnhanced Error
This commit is contained in:
parent
01f49f9a53
commit
df4d56aacf
1 changed files with 4 additions and 1 deletions
|
@ -25,7 +25,10 @@ export class LimitedMap<K, V> {
|
|||
set(key: K, value: V) {
|
||||
if (settings.store.cacheLimit > 0 && this.map.size >= settings.store.cacheLimit) {
|
||||
// delete the first entry
|
||||
this.map.delete(this.map.keys().next().value);
|
||||
const firstKey = this.map.keys().next().value;
|
||||
if (firstKey !== undefined) {
|
||||
this.map.delete(firstKey);
|
||||
}
|
||||
}
|
||||
this.map.set(key, value);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue