Make aspnet-webpack resilient against Webpack configs with nonstring entrypoints. Fixes #376.

This commit is contained in:
SteveSandersonMS
2016-10-17 11:41:23 +01:00
parent 418255e148
commit 99bf212cce
2 changed files with 2 additions and 2 deletions

View File

@@ -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": {

View File

@@ -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;
}
}