Skip to content

Commit

Permalink
Don't crash if this.drop is undefined on the next tick
Browse files Browse the repository at this point in the history
  • Loading branch information
SohumB committed May 23, 2015
1 parent 1f44633 commit f149aab
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
4 changes: 3 additions & 1 deletion dist/js/drop.js
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,9 @@ function createContext() {
addClass(this.drop, '' + drop.classPrefix + '-open-transitionend');

setTimeout(function () {
addClass(_this3.drop, '' + drop.classPrefix + '-after-open');
if (_this3.drop) {
addClass(_this3.drop, '' + drop.classPrefix + '-after-open');
}
});

if (typeof this.tether !== 'undefined') {
Expand Down
2 changes: 1 addition & 1 deletion dist/js/drop.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion src/js/drop.js
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,9 @@ function createContext(options={}) {
addClass(this.drop, `${ drop.classPrefix }-open-transitionend`);

setTimeout(() => {
addClass(this.drop, `${ drop.classPrefix }-after-open`);
if (this.drop) {
addClass(this.drop, `${ drop.classPrefix }-after-open`);
}
})

if (typeof this.tether !== 'undefined') {
Expand Down

0 comments on commit f149aab

Please sign in to comment.