Skip to content

Commit

Permalink
Issue 173 (#174)
Browse files Browse the repository at this point in the history
* fix maven configuration (test resources)

* Fix NPe in tests - Closes #173
  • Loading branch information
tchemit committed Nov 27, 2023
1 parent 8f35506 commit 9ca85f8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 8 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,14 @@
<sourceDirectory>src</sourceDirectory>
<testSourceDirectory>test</testSourceDirectory>
<outputDirectory>target/classes</outputDirectory>
<testResources>
<testResource>
<directory>test</directory>
<includes>
<include>**/*.yml</include>
</includes>
</testResource>
</testResources>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
Expand Down
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 9ca85f8

Please sign in to comment.