From d0d339cc7301ce54e8e124c15e95c8aa5ff44479 Mon Sep 17 00:00:00 2001 From: Mark Herwege Date: Mon, 30 Jan 2023 19:56:01 +0100 Subject: [PATCH] Fix jsonArray no such method exception IsEmpty() only available with gson starting version 2.8.7. --- .../binding/mybmw/internal/console/MyBMWCommandExtension.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; }