Skip to content

Commit b0a78ce

Browse files
committed
Check if onClose callback is provided before firing.
1 parent af34ffe commit b0a78ce

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

src/datetime-range.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,10 @@ angular.module('g1b.datetime-range', []).
9191
scope.close = function () {
9292
scope.selected = '';
9393
scope.calendarActive = false;
94-
scope.onClose();
94+
95+
if ( !!scope.onClose ) {
96+
scope.onClose();
97+
}
9598
}
9699

97100
// Bind click events outside directive to close edit popover

0 commit comments

Comments
 (0)