diff --git a/bundles/org.openhab.binding.mybmw/src/main/java/org/openhab/binding/mybmw/internal/console/MyBMWCommandExtension.java b/bundles/org.openhab.binding.mybmw/src/main/java/org/openhab/binding/mybmw/internal/console/MyBMWCommandExtension.java index a1d60344621ba..66795c4d2612e 100644 --- a/bundles/org.openhab.binding.mybmw/src/main/java/org/openhab/binding/mybmw/internal/console/MyBMWCommandExtension.java +++ b/bundles/org.openhab.binding.mybmw/src/main/java/org/openhab/binding/mybmw/internal/console/MyBMWCommandExtension.java @@ -234,7 +234,7 @@ private String prettyJson(String json) { private void writeJsonToFile(String pathString, String filename, String json) throws IOException { try { JsonElement element = JsonParser.parseString(json); - if (element.isJsonNull() || (element.isJsonArray() && ((JsonArray) element).isEmpty())) { + if (element.isJsonNull() || (element.isJsonArray() && ((JsonArray) element).size() > 0)) { // Don't write a file if empty return; }