From 5d5f1779c61f113b73a3875c49b5a880dd840d87 Mon Sep 17 00:00:00 2001 From: Richard Harrison Date: Sat, 21 Nov 2020 12:18:22 +0100 Subject: [PATCH] Reduce severity of ".." at model root It seems more sensible to return nullptr rather than throwing an exception. --- simgear/props/props.cxx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/simgear/props/props.cxx b/simgear/props/props.cxx index 6b36ea73..c8b72b2f 100755 --- a/simgear/props/props.cxx +++ b/simgear/props/props.cxx @@ -472,8 +472,10 @@ find_node_aux(SGPropertyNode * current, SplitItr& itr, bool create, return find_node_aux(current, ++itr, create, last_index); if (equals(name, "..")) { SGPropertyNode * parent = current->getParent(); - if (parent == 0) - throw std::runtime_error("attempt to move past root with '..'"); + if (parent == 0) { + SG_LOG(SG_GENERAL, SG_ALERT, "attempt to move past root with '..' node " << current->getName()); + return nullptr; + } return find_node_aux(parent, ++itr, create, last_index); } int index = -1;