diff --git a/src/main/java/com/github/brenoepics/at4j/data/DetectedLanguage.java b/src/main/java/com/github/brenoepics/at4j/data/DetectedLanguage.java index 9380896..0eec7ae 100644 --- a/src/main/java/com/github/brenoepics/at4j/data/DetectedLanguage.java +++ b/src/main/java/com/github/brenoepics/at4j/data/DetectedLanguage.java @@ -61,10 +61,14 @@ public static DetectedLanguage ofJSON(ObjectNode jsonNode) { DetectedLanguage detected = new DetectedLanguage(jsonNode.get("language").asText(), jsonNode.get("score").floatValue()); - if (jsonNode.has("isTranslationSupported")) + if (jsonNode.has("isTranslationSupported")) { detected.isTranslationSupported = jsonNode.get("isTranslationSupported").asBoolean(); - if (jsonNode.has("isTransliterationSupported")) + } + + if (jsonNode.has("isTransliterationSupported")) { detected.isTransliterationSupported = jsonNode.get("isTransliterationSupported").asBoolean(); + } + return detected; }