From 99bf212ccef5eec8b17f6f516b886fe22da6cf86 Mon Sep 17 00:00:00 2001 From: SteveSandersonMS Date: Mon, 17 Oct 2016 11:41:23 +0100 Subject: [PATCH] Make aspnet-webpack resilient against Webpack configs with nonstring entrypoints. Fixes #376. --- .../npm/aspnet-webpack/package.json | 2 +- .../npm/aspnet-webpack/src/WebpackDevMiddleware.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Microsoft.AspNetCore.SpaServices/npm/aspnet-webpack/package.json b/src/Microsoft.AspNetCore.SpaServices/npm/aspnet-webpack/package.json index ef077ec..aaf8b37 100644 --- a/src/Microsoft.AspNetCore.SpaServices/npm/aspnet-webpack/package.json +++ b/src/Microsoft.AspNetCore.SpaServices/npm/aspnet-webpack/package.json @@ -1,6 +1,6 @@ { "name": "aspnet-webpack", - "version": "1.0.20", + "version": "1.0.21", "description": "Helpers for using Webpack in ASP.NET Core projects. Works in conjunction with the Microsoft.AspNetCore.SpaServices NuGet package.", "main": "index.js", "scripts": { diff --git a/src/Microsoft.AspNetCore.SpaServices/npm/aspnet-webpack/src/WebpackDevMiddleware.ts b/src/Microsoft.AspNetCore.SpaServices/npm/aspnet-webpack/src/WebpackDevMiddleware.ts index f0e9770..7772a2a 100644 --- a/src/Microsoft.AspNetCore.SpaServices/npm/aspnet-webpack/src/WebpackDevMiddleware.ts +++ b/src/Microsoft.AspNetCore.SpaServices/npm/aspnet-webpack/src/WebpackDevMiddleware.ts @@ -231,7 +231,7 @@ function getPath(publicPath: string) { function firstIndexOfStringStartingWith(array: string[], prefixToFind: string) { for (let index = 0; index < array.length; index++) { const candidate = array[index]; - if (candidate.substring(0, prefixToFind.length) === prefixToFind) { + if ((typeof candidate === 'string') && (candidate.substring(0, prefixToFind.length) === prefixToFind)) { return index; } }