Accept plain strings for components

Addresses #1968
This commit is contained in:
KennyTV 2020-08-06 10:15:38 +02:00
parent cf7d49aec5
commit ea0f91136e
No known key found for this signature in database
GPG Key ID: 6BE3B555EBC5982B

View File

@ -106,8 +106,12 @@ public class ComponentRewriter {
processText(root);
return root;
} catch (JsonSyntaxException e) {
Via.getPlatform().getLogger().severe("Error when trying to parse json: " + value);
throw e;
if (Via.getManager().isDebug()) {
Via.getPlatform().getLogger().severe("Error when trying to parse json: " + value);
throw e;
}
// Yay to malformed json being accepted
return new JsonPrimitive(value);
}
}