Skip to content

Commit

Permalink
Fix NPE
Browse files Browse the repository at this point in the history
  • Loading branch information
Anastasia Smirnova committed Jul 13, 2020
1 parent 3fea1cb commit 1b8b282
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions demo/time-picker-advanced-demos.html
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ <h3>Custom Validator</h3>
window.addDemoReadyListener('#time-picker-advanced-demos-custom-validator', function(document) {
class TimePickerWorkingHoursElement extends Vaadin.TimePickerElement {
checkValidity() {
if (!this.value) {
return false;
}
var hour = /^(\d+)/.exec(this.value)[1];
return hour >= 9 && hour < 17;
}
Expand Down

0 comments on commit 1b8b282

Please sign in to comment.