← Back to team overview

linuxdcpp-team team mailing list archive

[Branch ~dcplusplus-team/dcplusplus/trunk] Rev 2823: add a safety check when switching tabs (might fix #909465)

 

------------------------------------------------------------
revno: 2823
committer: poy <poy@xxxxxxxxxx>
branch nick: trunk
timestamp: Mon 2012-01-16 19:17:19 +0100
message:
  add a safety check when switching tabs (might fix #909465)
modified:
  dwt/src/widgets/TabView.cpp


--
lp:dcplusplus
https://code.launchpad.net/~dcplusplus-team/dcplusplus/trunk

Your team Dcplusplus-team is subscribed to branch lp:dcplusplus.
To unsubscribe from this branch go to https://code.launchpad.net/~dcplusplus-team/dcplusplus/trunk/+edit-subscription
=== modified file 'dwt/src/widgets/TabView.cpp'
--- dwt/src/widgets/TabView.cpp	2012-01-15 13:52:55 +0000
+++ dwt/src/widgets/TabView.cpp	2012-01-16 18:17:19 +0000
@@ -293,17 +293,16 @@
 	}
 
 	TabInfo* old = getTabInfo(active);
-
 	TabInfo* ti = getTabInfo(i);
+	active = i;
 
-	if(ti == old)
+	if(!ti || ti == old)
 		return;
 
 	swapWidgets(old ? old->w : 0, ti->w);
 
 	if(!inTab)
 		setTop(ti->w);
-	active = i;
 
 	if(ti->marked) {
 		ti->marked = false;