Filter out "undefined" stopping strings

This commit is contained in:
Cohee
2023-09-21 22:02:51 +03:00
parent d8380a390a
commit 6ae1b7a72b
2 changed files with 3 additions and 3 deletions

View File

@ -1716,8 +1716,8 @@ export function getCustomStoppingStrings(limit = undefined) {
return [];
}
// Make sure all the elements are strings.
strings = strings.filter((s) => typeof s === 'string');
// Make sure all the elements are strings and non-empty.
strings = strings.filter(s => typeof s === 'string' && s.length > 0);
// Substitute params if necessary
if (power_user.custom_stopping_strings_macro) {