Merge pull request #3111 from kallewoof/202411-avoid-missing-ct Template derivation: explicitly skip empty templates

0143ce199ae7e0ed687821d3b20804f9241e0133

Cohee <18619528+Cohee1207@users.noreply.github.com>

Signed
1 files changed, +5 -0Showing whitespace changes
public/scripts/chat-templates.js+5 -0
@@ -65,6 +65,11 @@ const parse_derivation = derivation => (typeof derivation === 'string') ? {
6565} : derivation;
6666
6767export async function deriveTemplatesFromChatTemplate(chat_template, hash) {
68+ if (chat_template.trim() === '') {
69+ console.log('Missing chat template.');
70+ return null;
71+ }
72+
6873 if (hash in hash_derivations) {
6974 return parse_derivation(hash_derivations[hash]);
7075 }