Skip to content

Commit

Permalink
handle undefined reagents text or conditions text
Browse files Browse the repository at this point in the history
  • Loading branch information
novakps committed Jan 17, 2011
1 parent 3791a8e commit 0b37c59
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions kemia/model/reaction.js
Original file line number Diff line number Diff line change
Expand Up @@ -240,10 +240,14 @@ kemia.model.Reaction.prototype.setArrow = function(arrow) {
/**
* setter
*
* @param{string} text
* @param{string=} text
*/
kemia.model.Reaction.prototype.setReagentsText = function(text){
this.reagentsText = text;
if(text){
this.reagentsText = text;
} else {
this.reagentsText = "";
}
};

/**
Expand All @@ -267,10 +271,15 @@ kemia.model.Reaction.prototype.getConditionsText = function(){
/**
* setter
*
* @param{string} text
* @param{string=} text
*/
kemia.model.Reaction.prototype.setConditionsText = function(text){
this.conditionsText = text;
if(text){
this.conditionsText = text;
} else {
this.conditionsText = '';
}

}

/**
Expand Down

0 comments on commit 0b37c59

Please sign in to comment.