Skip to content
This repository has been archived by the owner on Jun 12, 2024. It is now read-only.

Commit

Permalink
fix(page): cannot read property 'options' of null
Browse files Browse the repository at this point in the history
checks if the router instance is defined in the plugin configuration, otherwise is not used to prepend the path with the base url

closes #72
  • Loading branch information
MatteoGabriele committed Nov 15, 2017
1 parent 7b7dbdf commit c45690d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/lib/page.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,11 @@ export default function page (...args) {
} = config

const queryString = getQueryString(route.query)
const needsBase = prependBase && router.options.base
const base = router && router.options.base
const needsBase = prependBase && base

let path = route.path + (transformQueryString ? queryString : '')
path = needsBase ? getBasePath(router.options.base, path) : path
path = needsBase ? getBasePath(base, path) : path

set('page', path)

Expand Down

0 comments on commit c45690d

Please sign in to comment.