Skip to content

Commit

Permalink
check all prop types
Browse files Browse the repository at this point in the history
  • Loading branch information
codebytere committed May 29, 2018
1 parent eb1fcb5 commit 5412666
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lib/browser/api/dialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -176,15 +176,17 @@ module.exports = {
throw new TypeError('Detail must be a string')
}
if (typeof checkboxLabel !== 'string') {
throw new TypeError('checkboxLabel must be a string')
throw new TypeError('Checkbox label must be a string')
}
if (typeof checkboxChecked !== 'boolean') {
throw new TypeError('Checkbox checked value must be a boolean')
}
checkboxChecked = !!checkboxChecked

if (normalizeAccessKeys) {
buttons = buttons.map(normalizeAccessKey)
}

checkboxChecked = !!checkboxChecked

// Choose a default button to get selected when dialog is cancelled.
if (cancelId == null) {
cancelId = 0
Expand Down

0 comments on commit 5412666

Please sign in to comment.