Add nonNull check for serviceAtom Description
@@ -10,6 +10,7 @@ import won.protocol.vocabulary.WXHOLD;
import won.protocol.vocabulary.WXREVIEW;
import java.net.URI;
+import java.util.Objects;
public class ServiceAtomModelWrapper extends DefaultAtomModelWrapper {
// TODO: ADD MORE SERVICE BOT ATOM CONTENT MAKE SOCKETS CONFIGURABLE
@@ -23,14 +24,16 @@ public class ServiceAtomModelWrapper extends DefaultAtomModelWrapper {
super(atomUri);
// SET CONTENT OBJECT
this.serviceAtomContent = serviceAtomContent;
+ // SET RDF STRUCTURE
Resource atom = this.getAtomModel().createResource(atomUri.toString());
atom.addProperty(RDF.type, WXBOT.ServiceAtom);
- // SET RDF STRUCTURE
- this.setTitle(serviceAtomContent.getName());
- this.setDescription(serviceAtomContent.getDescription());
this.addSocket("#HolderSocket", WXHOLD.HolderSocketString);
this.addSocket("#ChatSocket", WXCHAT.ChatSocketString);
this.addSocket("#ReviewSocket", WXREVIEW.ReviewSocketString);
+ this.setTitle(serviceAtomContent.getName());
+ if (Objects.nonNull(serviceAtomContent.getDescription())) {
+ this.setDescription(serviceAtomContent.getDescription());
+ }
}
public ServiceAtomModelWrapper(Dataset atomDataset) {
