pvalink: missing NULL check

This commit is contained in:
Michael Davidsaver
2021-04-23 15:29:45 -07:00
parent ff22538129
commit d18e2219b3

View File

@ -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