null element handling for structure/union array

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

No files matched your search

+7 -2
View File
@@ -231,8 +231,13 @@ std::ostream& PVUnionArray::dumpValue(std::ostream& o) const
std::ostream& PVUnionArray::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;
}