Fix mes examples being undefined if empty

This commit is contained in:
Nodude 2025-01-18 14:07:09 +01:00
parent d1f1299d43
commit 4fdff9fce2

View File

@ -3827,7 +3827,7 @@ export async function Generate(type, { automatic_trigger, force_name2, quiet_pro
* @returns {string[]} Examples array with block heading
*/
function parseMesExamples(examplesStr) {
if (examplesStr.length === 0 || examplesStr === '<START>') {
if (!examplesStr || examplesStr.length === 0 || examplesStr === '<START>') {
return [];
}