mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Filter out "undefined" stopping strings
This commit is contained in:
@ -1848,7 +1848,7 @@ function getStoppingStrings(isImpersonate) {
|
|||||||
if (group && Array.isArray(group.members)) {
|
if (group && Array.isArray(group.members)) {
|
||||||
const names = group.members
|
const names = group.members
|
||||||
.map(x => characters.find(y => y.avatar == x))
|
.map(x => characters.find(y => y.avatar == x))
|
||||||
.filter(x => x && x.name !== name2)
|
.filter(x => x && x.name && x.name !== name2)
|
||||||
.map(x => `\n${x.name}:`);
|
.map(x => `\n${x.name}:`);
|
||||||
result.push(...names);
|
result.push(...names);
|
||||||
}
|
}
|
||||||
|
@ -1716,8 +1716,8 @@ export function getCustomStoppingStrings(limit = undefined) {
|
|||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
// Make sure all the elements are strings.
|
// Make sure all the elements are strings and non-empty.
|
||||||
strings = strings.filter((s) => typeof s === 'string');
|
strings = strings.filter(s => typeof s === 'string' && s.length > 0);
|
||||||
|
|
||||||
// Substitute params if necessary
|
// Substitute params if necessary
|
||||||
if (power_user.custom_stopping_strings_macro) {
|
if (power_user.custom_stopping_strings_macro) {
|
||||||
|
Reference in New Issue
Block a user