madskristensen / NpmTaskRunner

Visual Studio extension
Other
88 stars 32 forks source link

Fix NullReferenceException in TaskParser.LoadTasks #16

Closed scottaddie closed 8 years ago

scottaddie commented 8 years ago

When creating a new ASP.NET Core project via the project template, the generated package.json file doesn't define a scripts property. Because the scripts property isn't present, the code in TaskParser.LoadTasks fails with an object reference error:

nullreferenceexception

The code was assuming that the scripts section is always present. This PR adds a null check before trying to access the property's children.