setSpatial override cause nullpointer in getAttachmentsNode in rev 7726 for SkeletonControl

Hi,

in rev 7726, SetSpatial was overriden in SkeletonControl

[java] @Override

public void setSpatial(Spatial spatial){

if (spatial != null){

Node node = (Node) spatial;

targets = findTargets(node);

}else{

targets = null;

}

}[/java]

But parent setSpatial was not called, thefore AbestractControl member spatial is not set.

and when you call getAttachmentsNode, you get a nice nullPointer at model.attachChild(n);

[java]public Node getAttachmentsNode(String boneName) {

Bone b = skeleton.getBone(boneName);

if (b == null) {

throw new IllegalArgumentException("Given bone name does not exist "

  • "in the skeleton.");

    }

    Node n = b.getAttachmentsNode();

    Node model = (Node) spatial;

    model.attachChild(n);

    return n;

    }[/java]

    Override should add

    super.setSpatial(spatial);

    so like

    [java] @Override

    public void setSpatial(Spatial spatial){

    super.setSpatial(spatial);

    if (spatial != null){

    Node node = (Node) spatial;

    targets = findTargets(node);

    }else{

    targets = null;

    }

    }[/java]

tsktsk, thanks.

np, damn that was quick to have feedback :slight_smile: are you a real human?

no I am german ^^

:slight_smile:

@normen leck meine stiefel 8)

Lol, that the only german sentence you know? xD Hint: Dont try it on german girls :stuck_out_tongue:

lol thats my chat up line :wink:

@normen do you know approx when the fix will be commited to svn?

thx

pit

done in last svn

thx a lot