Skip to content

Commit

Permalink
Fixed bug if direct access returned 0
Browse files Browse the repository at this point in the history
  • Loading branch information
seth-visere committed Jun 16, 2011
1 parent 1fd9084 commit f00d4cc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
5 changes: 3 additions & 2 deletions src/DAT/GUI/Controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ DAT.GUI.Controller.prototype.unlisten = function() {
};

DAT.GUI.Controller.prototype.setValue = function(n) {
if(this.object[this.propertyName]){
if(this.object[this.propertyName] != undefined){
this.object[this.propertyName] = n;
}else{
var o = new Object();
Expand All @@ -57,7 +57,8 @@ DAT.GUI.Controller.prototype.setValue = function(n) {
};

DAT.GUI.Controller.prototype.getValue = function() {
var val = this.object[this.propertyName] || this.object.get(this.propertyName);
var val = this.object[this.propertyName];
if(val == undefined) this.object.get(this.propertyName);
return val;
};

Expand Down
3 changes: 2 additions & 1 deletion src/DAT/GUI/GUI.js
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,8 @@ DAT.GUI = function(parameters) {
// return;
}

var value = object[propertyName] || (object.get && object.get(propertyName));
var value = object[propertyName];
if(value == undefined && object.get) value = object.get(propertyName));

// Does this value exist? Is it accessible?
if (value == undefined) {
Expand Down

0 comments on commit f00d4cc

Please sign in to comment.