Check for null pointer when parsing identities.
[yangtools.git] / yang / yang-data-impl / src / main / java / org / opendaylight / yangtools / yang / data / impl / codec / xml / InstanceIdentifierForXmlCodec.java
index 0ad2fc213438c39e23fc2eb530dd1d06984c918c..7f8167e451559e0643d310a2967272c8c0a043fd 100644 (file)
@@ -152,7 +152,8 @@ public final class InstanceIdentifierForXmlCodec {
             throw new IllegalArgumentException("It wasn't possible to get namespace for prefix " + prefix);
         }
 
-        Module module = schemaContext.findModuleByNamespaceAndRevision(namespace, null);
+        final Module module = schemaContext.findModuleByNamespaceAndRevision(namespace, null);
+        Preconditions.checkNotNull(module, "Unknown module: %s, cannot parse identity %s", namespace, xPathArgument);
         return QName.create(module.getQNameModule(), identifier);
     }