mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Don't throw in array/dict conversion
This commit is contained in:
@ -79,7 +79,8 @@ export function convertValueType(value, type) {
|
|||||||
if (Array.isArray(parsedArray)) {
|
if (Array.isArray(parsedArray)) {
|
||||||
return parsedArray;
|
return parsedArray;
|
||||||
}
|
}
|
||||||
throw new Error('Value is not an array.');
|
// The value is not an array
|
||||||
|
return [];
|
||||||
} catch {
|
} catch {
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
@ -92,7 +93,8 @@ export function convertValueType(value, type) {
|
|||||||
if (typeof parsedObject === 'object') {
|
if (typeof parsedObject === 'object') {
|
||||||
return parsedObject;
|
return parsedObject;
|
||||||
}
|
}
|
||||||
throw new Error('Value is not an object.');
|
// The value is not an object
|
||||||
|
return {};
|
||||||
} catch {
|
} catch {
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user