Skip to content

Commit ef20ccf

Browse files
committed
Coverity warning
Fixing coverity warning CID 896860, possible defrerenced pointer due to `dynamic_cast`
1 parent 481e12d commit ef20ccf

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/pagedef.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ void PageDefImpl::writeDocumentation(OutputList &ol)
240240
bool generateTreeView = Config_getBool(GENERATE_TREEVIEW);
241241
int hierarchyLevel = -1; // Pages start at the root
242242
PageDef *pd = this;
243-
while (pd->hasParentPage())
243+
while (pd && pd->hasParentPage())
244244
{
245245
pd = dynamic_cast<PageDef *>(pd->getOuterScope());
246246
++hierarchyLevel;

0 commit comments

Comments
 (0)