Skip to content

Commit

Permalink
pvalink: missing NULL check
Browse files Browse the repository at this point in the history
  • Loading branch information
mdavidsaver committed Apr 23, 2021
1 parent ff22538 commit d18e221
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pdbApp/pvalink_link.cpp
Expand Up @@ -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
Expand Down

0 comments on commit d18e221

Please sign in to comment.