|
From: <rv...@us...> - 2009-07-07 09:05:25
|
Revision: 179
http://treebase.svn.sourceforge.net/treebase/?rev=179&view=rev
Author: rvos
Date: 2009-07-07 09:05:13 +0000 (Tue, 07 Jul 2009)
Log Message:
-----------
NPE prevention changes
Modified Paths:
--------------
trunk/treebase-core/src/main/java/org/cipres/treebase/domain/nexus/nexml/NexmlTreeBlockConverter.java
Modified: trunk/treebase-core/src/main/java/org/cipres/treebase/domain/nexus/nexml/NexmlTreeBlockConverter.java
===================================================================
--- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/nexus/nexml/NexmlTreeBlockConverter.java 2009-07-06 10:04:34 UTC (rev 178)
+++ trunk/treebase-core/src/main/java/org/cipres/treebase/domain/nexus/nexml/NexmlTreeBlockConverter.java 2009-07-07 09:05:13 UTC (rev 179)
@@ -84,11 +84,21 @@
if ( null != phyloTree.getLabel() ) {
xmlTree.setLabel(phyloTree.getLabel());
}
- xmlTree.addAnnotationValue("tb:identifier.tree", mTBTermsURI, phyloTree.getId());
- xmlTree.addAnnotationValue("tb:kind.tree", mTBTermsURI, phyloTree.getKindDescription());
- xmlTree.addAnnotationValue("tb:type.tree", mTBTermsURI, phyloTree.getTypeDescription());
- xmlTree.addAnnotationValue("tb:quality.tree", mTBTermsURI, phyloTree.getQualityDescription());
- xmlTree.addAnnotationValue("tb:ntax.tree", mTBTermsURI, phyloTree.getnTax());
+ if ( null != phyloTree.getId() ) {
+ xmlTree.addAnnotationValue("tb:identifier.tree", mTBTermsURI, phyloTree.getId());
+ }
+ if ( null != phyloTree.getKindDescription() ) {
+ xmlTree.addAnnotationValue("tb:kind.tree", mTBTermsURI, phyloTree.getKindDescription());
+ }
+ if ( null != phyloTree.getTypeDescription() ) {
+ xmlTree.addAnnotationValue("tb:type.tree", mTBTermsURI, phyloTree.getTypeDescription());
+ }
+ if ( null != phyloTree.getQualityDescription() ) {
+ xmlTree.addAnnotationValue("tb:quality.tree", mTBTermsURI, phyloTree.getQualityDescription());
+ }
+ if ( null != phyloTree.getnTax() ) {
+ xmlTree.addAnnotationValue("tb:ntax.tree", mTBTermsURI, phyloTree.getnTax());
+ }
attachTreeBaseID(xmlTree, phyloTree,PhyloTree.class);
copyTreeBaseTree(phyloTree, xmlTree);
return xmlTree;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|