updating for NIHVIVO-3494
"Add RDF leads to null pointer exception in certain cases". Including check for null to avoid null pointer exception.
This commit is contained in:
parent
1a201b9037
commit
02304f6bb8
1 changed files with 28 additions and 25 deletions
|
@ -91,8 +91,10 @@ public class JenaModelUtils {
|
||||||
ontModel.enterCriticalSection(Lock.READ);
|
ontModel.enterCriticalSection(Lock.READ);
|
||||||
try {
|
try {
|
||||||
try {
|
try {
|
||||||
for (Iterator rootClassIt = myWebappDaoFactory.getVClassDao()
|
List<VClass> rootClasses = myWebappDaoFactory.getVClassDao()
|
||||||
.getRootClasses().iterator(); rootClassIt.hasNext(); ) {
|
.getRootClasses();
|
||||||
|
if(rootClasses != null) {
|
||||||
|
for (Iterator rootClassIt = rootClasses.iterator(); rootClassIt.hasNext(); ) {
|
||||||
VClass rootClass = (VClass) rootClassIt.next();
|
VClass rootClass = (VClass) rootClassIt.next();
|
||||||
|
|
||||||
Individual classGroup = modelForClassgroups.createIndividual(
|
Individual classGroup = modelForClassgroups.createIndividual(
|
||||||
|
@ -116,6 +118,7 @@ public class JenaModelUtils {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
String errMsg = "Unable to create class groups automatically " +
|
String errMsg = "Unable to create class groups automatically " +
|
||||||
"based on class hierarchy";
|
"based on class hierarchy";
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue