[rkward-cvs] SF.net SVN: rkward: [1688] trunk/rkward/rkward/plugin/ rkabstractoptionselector.cpp

tfry at users.sourceforge.net tfry at users.sourceforge.net
Wed Mar 21 19:50:45 UTC 2007


Revision: 1688
          http://svn.sourceforge.net/rkward/?rev=1688&view=rev
Author:   tfry
Date:     2007-03-21 12:50:44 -0700 (Wed, 21 Mar 2007)

Log Message:
-----------
Fix potential crash in option selectors

Modified Paths:
--------------
    trunk/rkward/rkward/plugin/rkabstractoptionselector.cpp

Modified: trunk/rkward/rkward/plugin/rkabstractoptionselector.cpp
===================================================================
--- trunk/rkward/rkward/plugin/rkabstractoptionselector.cpp	2007-03-21 19:39:56 UTC (rev 1687)
+++ trunk/rkward/rkward/plugin/rkabstractoptionselector.cpp	2007-03-21 19:50:44 UTC (rev 1688)
@@ -72,9 +72,9 @@
 	}
 
 	updating = false;
-	number->setIntValue (selected);		// will also take care of activating the correct item
 	number->setMin (0);
 	number->setMax (i-1);
+	number->setIntValue (selected);		// will also take care of activating the correct item
 }
 
 RKComponentBase* RKAbstractOptionSelector::lookupComponent (const QString &identifier, QString *remainder) {
@@ -116,6 +116,10 @@
 	} else {
 		RK_ASSERT (false);
 	}
+	if (new_id < 0) {
+		RK_DO (qDebug ("no such option"), PLUGIN, DL_ERROR);
+		return;
+	}
 
 	updating = true;
 	setItemInGUI (new_id);


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the rkward-tracker mailing list