Skip to content

Commit

Permalink
fix(bug): check for defaultValue existence first
Browse files Browse the repository at this point in the history
Signed-off-by: Tobias Gurtzick <magic@wizardtales.com>
  • Loading branch information
wzrdtales committed Feb 11, 2019
1 parent 60d1f78 commit 18338bc
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,17 @@ var Base = Class.extend({
},

_prepareSpec: function(columnName, spec, options, tableName) {
if (spec.defaultValue.raw) {
spec.defaultValue.prep = spec.defaultValue.raw;
} else if (spec.defaultValue.special) {
this._translateSpecialDefaultValues(spec, options, tableName, columnName);
if (spec.defaultValue) {
if (spec.defaultValue.raw) {
spec.defaultValue.prep = spec.defaultValue.raw;
} else if (spec.defaultValue.special) {
this._translateSpecialDefaultValues(
spec,
options,
tableName,
columnName
);
}
}
},

Expand Down

0 comments on commit 18338bc

Please sign in to comment.