diff --git a/src/factory/PVStructure.cpp b/src/factory/PVStructure.cpp index 3977151..5d61056 100644 --- a/src/factory/PVStructure.cpp +++ b/src/factory/PVStructure.cpp @@ -170,7 +170,7 @@ PVField* PVStructure::GetAsImpl(const char *name) const if(*sep) { // this is not the requested leaf parent = dynamic_cast(child); - if(!child) + if(!parent) throw std::runtime_error("mid-field is not a PVStructure"); //TODO: which sub field? child = NULL; name = sep+1; // skip past '.'