diff --git a/lib/browser/api/touch-bar.js b/lib/browser/api/touch-bar.js index 7f997edde87c..62b3e2195b58 100644 --- a/lib/browser/api/touch-bar.js +++ b/lib/browser/api/touch-bar.js @@ -235,11 +235,14 @@ TouchBar.TouchBarScrubber = class TouchBarScrubber extends TouchBarItem { constructor (config) { super() if (config == null) config = {} - const {items, onSelect, onHighlight} = config + const {items} = config + let {onSelect, onHighlight} = config this.type = 'scrubber' this._addLiveProperty('items', items) if (typeof onSelect === 'function' || typeof onHighlight === 'function') { + if (onSelect == null) onSelect = () => {} + if (onHighlight == null) onHighlight = () => {} this.onInteraction = (details) => { if (details.type === 'select') { onSelect(details.selectedIndex)