From 5f302ff42dbfd64abf30e54d54e89f642686d642 Mon Sep 17 00:00:00 2001 From: David <david.schiebener@kit.edu> Date: Thu, 26 Feb 2015 16:59:10 +0100 Subject: [PATCH] fixed a null handle exception that occurs when no orientation is given --- source/RobotAPI/libraries/core/FramedPose.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/source/RobotAPI/libraries/core/FramedPose.cpp b/source/RobotAPI/libraries/core/FramedPose.cpp index 6f31a7419..c9c160c71 100644 --- a/source/RobotAPI/libraries/core/FramedPose.cpp +++ b/source/RobotAPI/libraries/core/FramedPose.cpp @@ -595,16 +595,21 @@ namespace armarx { VirtualRobot::LinkedCoordinate c(virtualRobot); std::string frame; - if(position) + if (position) { frame = position->getFrame(); - if(!frame.empty() && frame != orientation->getFrame()) - throw armarx::UserException("Error: frames mismatch"); + if (orientation) + { + if(!frame.empty() && frame != orientation->getFrame()) + { + throw armarx::UserException("Error: frames mismatch"); + } + } } else { - if(!orientation) + if (!orientation) armarx::UserException("createLinkedCoordinate: orientation and position are both NULL"); else frame = orientation->getFrame(); -- GitLab