From 332c8309f65a1abf11f3c3216eda1e5a7a85bdb9 Mon Sep 17 00:00:00 2001 From: kevin Date: Thu, 11 Jul 2024 11:02:26 -0400 Subject: [PATCH] cwObject.cpp : objectFromString() now returns an error when the 'lexId' is set to kErrorLexTId. --- cwObject.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/cwObject.cpp b/cwObject.cpp index 4120583..871766e 100644 --- a/cwObject.cpp +++ b/cwObject.cpp @@ -937,10 +937,13 @@ cw::rc_t cw::objectFromString( const char* s, object_t*& objRef ) // then make the parent 'object' the current node if( cnp->is_pair() && cnp->child_count()==2 ) cnp = cnp->parent; - - } + if( lexId == lex::kErrorLexTId ) + { + goto errLabel; + } + // if the root has only one child then make the child the root if( root != nullptr && root->child_count() == 1 ) {