Skip to content

Commit

Permalink
Merge pull request openhab#7 from mherwege/patch-1
Browse files Browse the repository at this point in the history
Fix jsonArray no such method exception
  • Loading branch information
martingrassl authored Jan 31, 2023
2 parents 83784c4 + d0d339c commit b989cb8
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit b989cb8

Please sign in to comment.