]> git.mxchange.org Git - flightgear.git/commitdiff
catch non-existent nodes, too
authormfranz <mfranz>
Tue, 23 May 2006 20:48:01 +0000 (20:48 +0000)
committermfranz <mfranz>
Tue, 23 May 2006 20:48:01 +0000 (20:48 +0000)
src/GUI/property_list.cxx

index 28dc91973d816bf4bb6c64a6546db67e0cbeb36e..f8eda89fa5335a69f9e11a1f87a96ddb4b832415 100644 (file)
@@ -295,15 +295,14 @@ void PropertyList::valueChanged(SGPropertyNode *nd)
 
 
 void PropertyList::setValue(const char *s)
-{
-    SGPropertyNode *p;
-    try {
-        p = fgGetNode(s, false);
-    } catch (const stdString& m) {
-        SG_LOG(SG_GENERAL, SG_DEBUG, "property-list: " << m);
-        return;
-    }
-    setCurrent(p);
+try {
+    SGPropertyNode *p = fgGetNode(s, false);
+    if (p)
+        setCurrent(p);
+    else
+        throw stdString("node doesn't exist");
+} catch (const stdString& m) {
+    SG_LOG(SG_GENERAL, SG_DEBUG, "property-list node `" << s << "': "<< m);
 }