From d18e2219b3ff13bf9ea4278dfb1ad7aebc53e903 Mon Sep 17 00:00:00 2001 From: Michael Davidsaver Date: Fri, 23 Apr 2021 15:29:45 -0700 Subject: [PATCH] pvalink: missing NULL check --- pdbApp/pvalink_link.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pdbApp/pvalink_link.cpp b/pdbApp/pvalink_link.cpp index cf15966..62e6f5b 100644 --- a/pdbApp/pvalink_link.cpp +++ b/pdbApp/pvalink_link.cpp @@ -89,7 +89,9 @@ pvd::PVField::const_shared_pointer pvaLink::getSubField(const char *name) } else { // we access a sub-struct ret = lchan->op_mon.root->getSubField(fieldName); - if(ret->getField()->getType()!=pvd::structure) { + if(!ret) { + // noop + } else if(ret->getField()->getType()!=pvd::structure) { // addressed sub-field isn't a sub-structure if(strcmp(name, "value")!=0) { // unless we are trying to fetch the "value", we fail here