Bugfix: fixed NPE error while getting subtarget of a constraint, not every constraint data have such field
git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9973 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
This commit is contained in:
parent
69205a679b
commit
2ace208225
@ -68,7 +68,10 @@ public abstract class Constraint {
|
|||||||
if(pTar!= null && pTar.isNotNull()) {
|
if(pTar!= null && pTar.isNotNull()) {
|
||||||
this.targetOMA = pTar.getOldMemoryAddress();
|
this.targetOMA = pTar.getOldMemoryAddress();
|
||||||
this.targetSpace = Space.valueOf(((Number) constraintStructure.getFieldValue("tarspace")).byteValue());
|
this.targetSpace = Space.valueOf(((Number) constraintStructure.getFieldValue("tarspace")).byteValue());
|
||||||
subtargetName = data.getFieldValue("subtarget").toString();
|
Object subtargetValue = data.getFieldValue("subtarget");
|
||||||
|
if(subtargetValue != null) {//not all constraint data have the subtarget field
|
||||||
|
subtargetName = subtargetValue.toString();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
//Null constraint has no data, so create it here
|
//Null constraint has no data, so create it here
|
||||||
|
Loading…
x
Reference in New Issue
Block a user