Cleanup codecs a bit
[yangtools.git] / yang / yang-data-impl / src / main / java / org / opendaylight / yangtools / yang / data / impl / schema / transform / base / parser / LeafNodeBaseParser.java
index f6b1dc060dc904a4f1ee474cca99f15af87028ef..ec65ebac277580cd1e02fc8cc247eb86dbb10395 100644 (file)
@@ -51,8 +51,10 @@ public abstract class LeafNodeBaseParser<E> implements ExtensibleParser<NodeIden
 
         leafBuilder.withAttributes(getAttributes(e));
 
+        @SuppressWarnings("rawtypes")
         final BuildingStrategy rawBuildingStrat = buildingStrategy;
-        return LeafInterner.forSchema(schema).intern((LeafNode<?>)rawBuildingStrat.build(leafBuilder.withValue(value)));
+        final LeafNode<?> sample = (LeafNode<?>)rawBuildingStrat.build(leafBuilder.withValue(value));
+        return sample == null ? null : LeafInterner.forSchema(schema).intern(sample);
     }
 
     /**