Don't throw in array/dict conversion

5563d4918490b601606d0b21a8e7f5543d13904e

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

1 files changed, +4 -2Showing whitespace changes
public/scripts/utils.js+4 -2
@@ -79,7 +79,8 @@ export function convertValueType(value, type) {
79 if (Array.isArray(parsedArray)) {79 if (Array.isArray(parsedArray)) {
80 return parsedArray;80 return parsedArray;
81 }81 }
82 throw new Error('Value is not an array.');82 // The value is not an array
83 return [];
83 } catch {84 } catch {
84 return [];85 return [];
85 }86 }
@@ -92,7 +93,8 @@ export function convertValueType(value, type) {
92 if (typeof parsedObject === 'object') {93 if (typeof parsedObject === 'object') {
93 return parsedObject;94 return parsedObject;
94 }95 }
95 throw new Error('Value is not an object.');96 // The value is not an object
97 return {};
96 } catch {98 } catch {
97 return {};99 return {};
98 }100 }