Skip to content

Commit 721bde6

Browse files
committed
Prevent possible NPE in error message. Closes #173.
1 parent f0a9b5d commit 721bde6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

xstream/src/java/com/thoughtworks/xstream/core/DefaultConverterLookup.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* Copyright (C) 2004, 2005, 2006 Joe Walnes.
3-
* Copyright (C) 2006, 2007, 2008, 2009, 2011, 2013, 2014, 2015, 2016, 2017 XStream Committers.
3+
* Copyright (C) 2006, 2007, 2008, 2009, 2011, 2013, 2014, 2015, 2016, 2017, 2019 XStream Committers.
44
* All rights reserved.
55
*
66
* The software in this package is published under the terms of the BSD
@@ -76,7 +76,7 @@ public Converter lookupConverterForType(final Class<?> type) {
7676
final ConversionException exception = new ConversionException(errors.isEmpty()
7777
? "No converter specified"
7878
: "No converter available");
79-
exception.add("type", type.getName());
79+
exception.add("type", type != null ? type.getName() : "null");
8080
for (final Map.Entry<String, String> entry : errors.entrySet()) {
8181
exception.add("converter", entry.getKey());
8282
exception.add("message", entry.getValue());

0 commit comments

Comments
 (0)