diff --git a/src/main/java/com/github/tomakehurst/wiremock/standalone/JsonFileMappingsSource.java b/src/main/java/com/github/tomakehurst/wiremock/standalone/JsonFileMappingsSource.java index b53484cbcb..a9d0b44d6b 100644 --- a/src/main/java/com/github/tomakehurst/wiremock/standalone/JsonFileMappingsSource.java +++ b/src/main/java/com/github/tomakehurst/wiremock/standalone/JsonFileMappingsSource.java @@ -149,9 +149,10 @@ private boolean hasFolderDefinition(final StubMapping mapping) { if (metadata == null) { return false; } - return metadata.getMap(WIREMOCK_GUI_KEY) != null - && metadata.getMap(WIREMOCK_GUI_KEY).get(DIR_KEY) != null - && metadata.getMap(WIREMOCK_GUI_KEY).get(DIR_KEY) instanceof String; + + return metadata.containsKey(WIREMOCK_GUI_KEY) + && metadata.getMap(WIREMOCK_GUI_KEY).get(DIR_KEY) != null + && metadata.getMap(WIREMOCK_GUI_KEY).get(DIR_KEY) instanceof String; } private String getFolderDefinition(final StubMapping mapping) {