null element handling for structure/union array

This commit is contained in:
Matej Sekoranja
2014-11-06 12:48:57 +01:00
parent c86e31ad99
commit 6117035863
3 changed files with 28 additions and 6 deletions

View File

@@ -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<temp.size())
o << *temp[index];
if (index<temp.size())
{
if (temp[index])
o << *temp[index];
else
o << "(none)" << std::endl;
}
return o;
}