Author: damoxc

Revision: 5974

Log:
        prevent undefineds ending up as a key in the option manager

Diff:
Modified: branches/1.2_RC/deluge/ui/web/js/Deluge.MultiOptionsManager.js
===================================================================
--- branches/1.2_RC/deluge/ui/web/js/Deluge.MultiOptionsManager.js      
2009-11-25 18:24:29 UTC (rev 5973)
+++ branches/1.2_RC/deluge/ui/web/js/Deluge.MultiOptionsManager.js      
2009-11-25 18:37:06 UTC (rev 5974)
@@ -146,7 +146,9 @@
         * @param {Object} value The value for the option
         */
        setDefault: function(option, value) {
-               if (value === undefined) {
+               if (option === undefined) {
+                       return;
+               } else if (value === undefined) {
                        for (var key in option) {
                                this.setDefault(key, option[key]);
                        }
@@ -175,7 +177,9 @@
         * @param {Object} [value];
         */
        update: function(option, value) {
-               if (value === undefined) {
+               if (option === undefined) {
+                       return;
+               } else if (value === undefined) {
                        for (var key in option) {
                                this.update(key, option[key]);
                        }

Modified: branches/1.2_RC/deluge/ui/web/js/Deluge.OptionsManager.js
===================================================================
--- branches/1.2_RC/deluge/ui/web/js/Deluge.OptionsManager.js   2009-11-25 
18:24:29 UTC (rev 5973)
+++ branches/1.2_RC/deluge/ui/web/js/Deluge.OptionsManager.js   2009-11-25 
18:37:06 UTC (rev 5974)
@@ -189,7 +189,9 @@
         * @param {Object} value The value for the option
         */
        set: function(option, value) {
-               if (typeof option == 'object') {
+               if (option === undefined) {
+                       return;
+               } else if (typeof option == 'object') {
                        var options = option;
                        this.options = Ext.apply(this.options, options);
                        for (var option in options) {
@@ -207,7 +209,9 @@
         * @param {Object} [value];
         */
        update: function(option, value) {
-               if (value === undefined) {
+               if (option === undefined) {
+                       return;
+               } else if (value === undefined) {
                        for (var key in option) {
                                this.update(key, option[key]);
                        }

Modified: trunk/deluge/ui/web/js/Deluge.MultiOptionsManager.js
===================================================================
--- trunk/deluge/ui/web/js/Deluge.MultiOptionsManager.js        2009-11-25 
18:24:29 UTC (rev 5973)
+++ trunk/deluge/ui/web/js/Deluge.MultiOptionsManager.js        2009-11-25 
18:37:06 UTC (rev 5974)
@@ -146,7 +146,9 @@
         * @param {Object} value The value for the option
         */
        setDefault: function(option, value) {
-               if (value === undefined) {
+               if (option === undefined) {
+                       return;
+               } else if (value === undefined) {
                        for (var key in option) {
                                this.setDefault(key, option[key]);
                        }
@@ -175,7 +177,9 @@
         * @param {Object} [value];
         */
        update: function(option, value) {
-               if (value === undefined) {
+               if (option === undefined) {
+                       return;
+               } else if (value === undefined) {
                        for (var key in option) {
                                this.update(key, option[key]);
                        }

Modified: trunk/deluge/ui/web/js/Deluge.OptionsManager.js
===================================================================
--- trunk/deluge/ui/web/js/Deluge.OptionsManager.js     2009-11-25 18:24:29 UTC 
(rev 5973)
+++ trunk/deluge/ui/web/js/Deluge.OptionsManager.js     2009-11-25 18:37:06 UTC 
(rev 5974)
@@ -189,7 +189,9 @@
         * @param {Object} value The value for the option
         */
        set: function(option, value) {
-               if (typeof option == 'object') {
+               if (option === undefined) {
+                       return;
+               } else if (typeof option == 'object') {
                        var options = option;
                        this.options = Ext.apply(this.options, options);
                        for (var option in options) {
@@ -207,7 +209,9 @@
         * @param {Object} [value];
         */
        update: function(option, value) {
-               if (value === undefined) {
+               if (option === undefined) {
+                       return;
+               } else if (value === undefined) {
                        for (var key in option) {
                                this.update(key, option[key]);
                        }


--

You received this message because you are subscribed to the Google Groups 
"deluge-commit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/deluge-commit?hl=en.


Reply via email to