Fix: Variables null

This commit is contained in:
Wender Teixeira
2023-10-05 11:43:18 -03:00
committed by GitHub
parent 6ff9c4578a
commit 6a3f82ed7e

View File

@@ -114,9 +114,11 @@ export class TypebotService {
instanceName: instance.instanceName,
};
variables.forEach((variable) => {
prefilledVariables[variable.name] = variable.value;
});
if (variables?.length) {
variables.forEach((variable: { name: string | number; value: string }) => {
prefilledVariables[variable.name] = variable.value;
});
}
if (startSession) {
const response = await this.createNewSession(instance, {