prevent undefineds ending up as a key in the option manager

This commit is contained in:
Damien Churchill 2009-11-25 18:37:06 +00:00
parent 93468f342a
commit a567b23262
2 changed files with 12 additions and 4 deletions

View File

@ -146,7 +146,9 @@ Deluge.MultiOptionsManager = Ext.extend(Deluge.OptionsManager, {
* @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 @@ Deluge.MultiOptionsManager = Ext.extend(Deluge.OptionsManager, {
* @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]);
}

View File

@ -189,7 +189,9 @@ Deluge.OptionsManager = Ext.extend(Ext.util.Observable, {
* @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 @@ Deluge.OptionsManager = Ext.extend(Ext.util.Observable, {
* @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]);
}