mirror of
https://github.com/magefree/mage.git
synced 2025-12-25 04:52:07 -08:00
Dev: updated json lib, added tests;
This commit is contained in:
parent
fa29b8a2a2
commit
c899c332b8
4 changed files with 203 additions and 8 deletions
|
|
@ -173,9 +173,7 @@ public enum ScryfallImageSource implements CardImageSource {
|
|||
}
|
||||
|
||||
// OK, found card data, parse it
|
||||
JsonParser jp = new JsonParser();
|
||||
JsonElement root = jp.parse(new InputStreamReader(jsonStream));
|
||||
JsonObject jsonCard = root.getAsJsonObject();
|
||||
JsonObject jsonCard = JsonParser.parseReader(new InputStreamReader(jsonStream)).getAsJsonObject();
|
||||
if (!jsonCard.has("card_faces")) {
|
||||
throw new MageException("Couldn't find card_faces in card's JSON data: " + jsonUrl);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue