Pixel-Composer/scripts/json_functions/json_functions.gml

9 lines
126 B
Text
Raw Normal View History

2023-03-05 07:16:44 +01:00
function json_try_parse(text, def = noone) {
2023-05-08 10:50:42 +02:00
try {
2023-03-05 07:16:44 +01:00
return json_parse(text);
2023-05-08 10:50:42 +02:00
} catch(e) {
2023-03-05 07:16:44 +01:00
return def;
2023-05-08 10:50:42 +02:00
}
2023-03-05 07:16:44 +01:00
return def;
}