Skip to content

Commit ce0fb12

Browse files
committed
address compiler warnings
Signed-off-by: Jimmy Tanagra <jcode@tanagra.id.au>
1 parent 25ac556 commit ce0fb12

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

  • bundles/org.openhab.core.model.yaml/src/main/java/org/openhab/core/model/yaml/internal/util/preprocessor

bundles/org.openhab.core.model.yaml/src/main/java/org/openhab/core/model/yaml/internal/util/preprocessor/ModelConstructor.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ public Object construct(@Nullable Node node) {
8989
String value = (String) constructScalar(scalarNode);
9090

9191
// don't interpolate single quoted strings
92-
if (scalarNode.getScalarStyle() == DumperOptions.ScalarStyle.SINGLE_QUOTED) {
92+
if (scalarNode == null || scalarNode.getScalarStyle() == DumperOptions.ScalarStyle.SINGLE_QUOTED) {
9393
return value;
9494
}
9595

@@ -196,11 +196,12 @@ public Object construct(@Nullable Node node) {
196196
return Map.of();
197197
}
198198

199+
@SuppressWarnings("unchecked")
199200
Map<String, String> vars = Optional.ofNullable(includeOptions.get("vars")).filter(Map.class::isInstance)
200201
.map(Map.class::cast).orElse(Map.of());
201202
return new IncludeObject(fileName, vars);
202203
} else {
203-
logger.warn("Invalid !include argument type: {}", node.getClass().getName());
204+
logger.warn("Invalid !include argument type: {}", node == null ? null : node.getClass().getName());
204205
}
205206
return Map.of();
206207
}

0 commit comments

Comments
 (0)