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)) {
|
||||
return parsedArray;
|
||||
}
|
||||
throw new Error('Value is not an array.');
|
||||
// The value is not an array
|
||||
return [];
|
||||
} catch {
|
||||
return [];
|
||||
}
|
||||
@ -92,7 +93,8 @@ export function convertValueType(value, type) {
|
||||
if (typeof parsedObject === 'object') {
|
||||
return parsedObject;
|
||||
}
|
||||
throw new Error('Value is not an object.');
|
||||
// The value is not an object
|
||||
return {};
|
||||
} catch {
|
||||
return {};
|
||||
}
|
||||
|
Reference in New Issue
Block a user