mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Safer estimation of possibly undefined values
This commit is contained in:
@ -696,7 +696,7 @@ export class LimitedMap {
|
|||||||
* @returns {number}
|
* @returns {number}
|
||||||
*/
|
*/
|
||||||
static estimateStringSize(str) {
|
static estimateStringSize(str) {
|
||||||
return str.length * 2;
|
return str ? str.length * 2 : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user