Fix NPE in YangTextSchemaSourceSerializationProxy#getRepresentation
[controller.git] / opendaylight / md-sal / sal-clustering-commons / src / main / java / org / opendaylight / controller / cluster / schema / provider / impl / YangTextSchemaSourceSerializationProxy.java
index 6e6c6a88f1086370b8a8a4073b361eb3c94310ef..39302e4f5621865130ef2c307843095af93862ae 100644 (file)
@@ -34,7 +34,7 @@ public class YangTextSchemaSourceSerializationProxy implements Serializable {
     }
 
     public YangTextSchemaSource getRepresentation() {
     }
 
     public YangTextSchemaSource getRepresentation() {
-        return YangTextSchemaSource.delegateForByteSource(RevisionSourceIdentifier.create(name, Optional.of(revision)),
-            ByteSource.wrap(schemaSource));
+        return YangTextSchemaSource.delegateForByteSource(
+                RevisionSourceIdentifier.create(name, Optional.fromNullable(revision)), ByteSource.wrap(schemaSource));
     }
 }
     }
 }