#2107 Check for null reference in prompt manager settings init
This commit is contained in:
parent
5084b4ae64
commit
2333fe64d0
|
@ -841,7 +841,7 @@ class PromptManager {
|
||||||
const promptReferences = this.getPromptOrderForCharacter(this.activeCharacter);
|
const promptReferences = this.getPromptOrderForCharacter(this.activeCharacter);
|
||||||
for (let i = promptReferences.length - 1; i >= 0; i--) {
|
for (let i = promptReferences.length - 1; i >= 0; i--) {
|
||||||
const reference = promptReferences[i];
|
const reference = promptReferences[i];
|
||||||
if (-1 === this.serviceSettings.prompts.findIndex(prompt => prompt.identifier === reference.identifier)) {
|
if (reference && -1 === this.serviceSettings.prompts.findIndex(prompt => prompt.identifier === reference.identifier)) {
|
||||||
promptReferences.splice(i, 1);
|
promptReferences.splice(i, 1);
|
||||||
this.log('Removed unused reference: ' + reference.identifier);
|
this.log('Removed unused reference: ' + reference.identifier);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue