diff --git a/src/factory/Compare.cpp b/src/factory/Compare.cpp index 6d902df..06b4e27 100644 --- a/src/factory/Compare.cpp +++ b/src/factory/Compare.cpp @@ -251,7 +251,13 @@ bool compareField(const PVStructureArray* left, const PVStructureArray* right) lit!=lend; ++lit, ++rit) { - if(**lit != **rit) + // element can be null + if (!(*lit) || !(*rit)) + { + if (*lit || *rit) + return false; + } + else if (**lit != **rit) return false; } return true; @@ -304,7 +310,13 @@ bool compareField(const PVUnionArray* left, const PVUnionArray* right) lit!=lend; ++lit, ++rit) { - if(**lit != **rit) + // element can be null + if (!(*lit) || !(*rit)) + { + if (*lit || *rit) + return false; + } + else if (**lit != **rit) return false; } return true; diff --git a/src/factory/PVStructureArray.cpp b/src/factory/PVStructureArray.cpp index 29e4663..b54ff85 100644 --- a/src/factory/PVStructureArray.cpp +++ b/src/factory/PVStructureArray.cpp @@ -232,8 +232,13 @@ std::ostream& PVStructureArray::dumpValue(std::ostream& o) const std::ostream& PVStructureArray::dumpValue(std::ostream& o, std::size_t index) const { const_svector temp(view()); - if(index