Skip to content

Commit

Permalink
Fix NPe in tests - Closes #173
Browse files Browse the repository at this point in the history
  • Loading branch information
tchemit committed Nov 27, 2023
1 parent 04b1607 commit ed82500
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/com/esotericsoftware/yamlbeans/YamlReader.java
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ private Class<?> chooseType (String tag, Class<?> defaultType, Class<?> provided
try {
Class<?> loadedFromTag = findTagClass(tag, classLoader);
if (loadedFromTag != null) {
if (!providedType.isAssignableFrom(loadedFromTag)) {
if (providedType != null && !providedType.isAssignableFrom(loadedFromTag)) {
throw new YamlReaderException("Class specified by tag is incompatible with expected type: "
+ loadedFromTag.getName() + " (expected " + providedType.getName() + ")");
}
Expand Down

0 comments on commit ed82500

Please sign in to comment.