fix null reference

This commit is contained in:
Eric Trombly
2020-06-25 06:57:50 -05:00
parent dc551e1fb0
commit 031a3d0816

View File

@@ -120,10 +120,10 @@ public:
mat *= linkMat;
mat.inverse();
Base::Vector3d pt = mat*Base::Vector3d(msg.x,msg.y,msg.z);
const SbVec3f &ptTo = *vp->pcLineCoords->point.getValues(vp->pt0Index);
auto ptTo = vp->pcLineCoords->point.getValues(vp->pt0Index);
SbVec3f ptFrom(pt.x,pt.y,pt.z);
if(ptFrom != ptTo) {
vp->pcArrowTransform->pointAt(ptFrom,ptTo);
if(ptTo && ptFrom != *ptTo) {
vp->pcArrowTransform->pointAt(ptFrom,*ptTo);
setArrow(vp->pcArrowSwitch);
return;
}