tracker: Fix PVS V595

Add NULL check for 'ContainerWindow()', since it might return NULL.

Change-Id: I0a9e7243c6d23be7559331dcd72e0675eb44809e
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2161
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
This commit is contained in:
Murai Takashi 2020-01-26 20:08:23 +09:00 committed by Adrien Destugues
parent c144c17f4f
commit 0404495f3b

View File

@ -8443,7 +8443,8 @@ BPoseView::SwitchDir(const entry_ref* newDirRef, AttributeStreamNode* node)
// check if model is a trash dir, if so
// update ContainerWindow's fIsTrash, etc.
// variables to indicate new state
ContainerWindow()->UpdateIfTrash(model);
if (ContainerWindow() != NULL)
ContainerWindow()->UpdateIfTrash(model);
StopWatching();
ClearPoses();
@ -8462,14 +8463,14 @@ BPoseView::SwitchDir(const entry_ref* newDirRef, AttributeStreamNode* node)
if (viewStateRestored) {
if (ViewMode() == kListMode && oldMode != kListMode) {
if (ContainerWindow())
if (ContainerWindow() != NULL)
ContainerWindow()->ShowAttributeMenu();
fTitleView->Show();
} else if (ViewMode() != kListMode && oldMode == kListMode) {
fTitleView->Hide();
if (ContainerWindow())
if (ContainerWindow() != NULL)
ContainerWindow()->HideAttributeMenu();
} else if (ViewMode() == kListMode && oldMode == kListMode)
fTitleView->Invalidate();
@ -8501,7 +8502,7 @@ BPoseView::SwitchDir(const entry_ref* newDirRef, AttributeStreamNode* node)
// be sure this happens after origin is set and window is sized
// properly for proper icon caching!
if (ContainerWindow()->IsTrash())
if (ContainerWindow() != NULL && ContainerWindow()->IsTrash())
AddTrashPoses();
else
AddPoses(TargetModel());