Catching NPE when classgroup has no display rank.
This commit is contained in:
parent
ecc1c05bb7
commit
b3fdb4fbfe
1 changed files with 6 additions and 2 deletions
|
@ -190,9 +190,13 @@ public class VClassGroupDaoJena extends JenaBaseDao implements VClassGroupDao {
|
|||
group.setLocalName(groupInd.getLocalName());
|
||||
try {
|
||||
DatatypeProperty drProp = (ModelFactory.createOntologyModel(OntModelSpec.OWL_MEM)).createDatatypeProperty(VitroVocabulary.DISPLAY_RANK);
|
||||
group.setDisplayRank(Integer.decode(((Literal)(groupInd.getProperty(drProp).getObject())).getString()).intValue());
|
||||
if( drProp == null ){
|
||||
log.debug("No display rank in model for portal " + groupInd.getURI() );
|
||||
}else{
|
||||
group.setDisplayRank(Integer.decode(((Literal)(groupInd.getProperty(drProp).getObject())).getString()).intValue());
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
log.warn("Cannot get display rank for portal " + groupInd.getURI() + " " + e.getMessage() );
|
||||
}
|
||||
return group;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue