From 8a43d8640fcbbcd4ae076a17676a834d49be47f3 Mon Sep 17 00:00:00 2001 From: Fadojutimi Temitayo Olusegun Date: Tue, 31 Dec 2019 23:37:11 +0100 Subject: [PATCH] fix: Cannot read property 'filter' of null --- lib/routes.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/routes.js b/lib/routes.js index 79c3fe8..459777a 100644 --- a/lib/routes.js +++ b/lib/routes.js @@ -11,7 +11,7 @@ function excludeRoutes(patterns, routes) { patterns.forEach(pattern => { const minimatch = new Minimatch(pattern) minimatch.negate = true - routes = routes.filter(({ url }) => minimatch.match(url)) + routes = (routes || []).filter(({ url }) => minimatch.match(url)) }) return routes }