1
0
Fork 0
mirror of https://github.com/terribleplan/next.js.git synced 2024-01-19 02:48:18 +00:00

Check if matched before reading value (#4096)

This commit is contained in:
Tim Neutkens 2018-04-02 21:18:33 +02:00 committed by GitHub
parent 2fa49d70b7
commit 9d4891f295
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -13,7 +13,12 @@ export default class PagesManifestPlugin {
const pages = {}
for (const entry of entries) {
const pagePath = MATCH_ROUTE_NAME.exec(entry.name)[1]
const result = MATCH_ROUTE_NAME.exec(entry.name)
if (!result) {
continue
}
const pagePath = result[1]
if (!pagePath) {
continue