handle case where cb is undefined
This commit is contained in:
parent
914d07df03
commit
f93685811a
1 changed files with 4 additions and 1 deletions
|
|
@ -20,7 +20,10 @@ LocationHistory.prototype._go = function (page, cb) {
|
|||
page.onbeforeload((err) => {
|
||||
if (this._pending !== page) return /* navigation was cancelled */
|
||||
this._pending = null
|
||||
if (err) return cb(err)
|
||||
if (err) {
|
||||
if (cb) cb(err)
|
||||
return
|
||||
}
|
||||
this._history.push(page)
|
||||
if (cb) cb()
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue