Skip to content

Commit

Permalink
Merge pull request #57 from eamador/destroySortableFix_56
Browse files Browse the repository at this point in the history
56 - Avoid error "Cannot read property destroy of undefined"
  • Loading branch information
smnbbrv committed Oct 19, 2017
2 parents 7bee9c3 + 0d9bbdf commit a39e7ee
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/sortablejs.directive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,9 @@ export class SortablejsDirective implements OnInit, OnChanges, OnDestroy {
}

public ngOnDestroy() {
this._sortable.destroy();
if (this._sortable) {
this._sortable.destroy();
}
}

private get options() {
Expand Down

0 comments on commit a39e7ee

Please sign in to comment.