only: NPE check

This commit is contained in:
rusefillc 2024-05-15 18:18:46 -04:00
parent c656271e7d
commit 38d0cecaaa
1 changed files with 1 additions and 0 deletions

View File

@ -83,6 +83,7 @@ public class LiveDataProcessor {
public static ArrayList<LinkedHashMap> getStringObjectMap(Reader reader) {
Yaml yaml = new Yaml();
Map<String, Object> objectMap = yaml.load(reader);
Objects.requireNonNull(objectMap, "content of " + reader);
if (objectMap.size() != 1)
throw new IllegalStateException("Exactly one top level key expected");
String key = objectMap.keySet().iterator().next();