⛏️ index : haiku.git

author Augustin Cavalier <waddlesplash@gmail.com> 2018-09-08 19:03:06.0 -04:00:00
committer Augustin Cavalier <waddlesplash@gmail.com> 2018-09-11 16:32:34.0 -04:00:00
commit
c392fee26264c1c82328a3d70730ded8433e8917 [patch]
tree
cd97771415c5cd2cf6df4bd7addb01e7294d6838
parent
dcb5519e5d117744e7255f04dd8b3e52ee7c8eba
download
c392fee26264c1c82328a3d70730ded8433e8917.tar.gz

Deskbar: Add missing NULL check in SwitchWindow().

All other functions in this file that locate the TTeamGroup via FindTeam()
do a NULL check afterwards, so the fact that this one did not just looks
like an oversight.

Fixes #14457.

Diff

 src/apps/deskbar/Switcher.cpp | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/apps/deskbar/Switcher.cpp b/src/apps/deskbar/Switcher.cpp
index 268d6d8..cf02f80 100644
--- a/src/apps/deskbar/Switcher.cpp
+++ b/src/apps/deskbar/Switcher.cpp
@@ -1098,7 +1098,7 @@
TSwitchManager::CountWindows(int32 groupIndex, bool )
{
	TTeamGroup* teamGroup = (TTeamGroup*)fGroupList.ItemAt(groupIndex);
	if (!teamGroup)
	if (teamGroup == NULL)
		return 0;

	int32 result = 0;
@@ -1146,6 +1146,8 @@

	int32 index;
	TTeamGroup* teamGroup = FindTeam(team, &index);
	if (teamGroup == NULL)
		return;

	// cycle through the windows in the active application
	int32 count;