Skip to content

Commit

Permalink
Fix: Rule manifest-app-name
Browse files Browse the repository at this point in the history
Report an error if the manifest content type is not valid.

----------------------

Fix webhintio#610
  • Loading branch information
sarvaje committed Oct 31, 2017
1 parent c997ef1 commit 79dc880
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/lib/rules/manifest-app-name/manifest-app-name.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,12 @@ const rule: IRuleBuilder = {

let jsonContent;

if (!content) {
await context.report(resource, null, 'Manifest file does not contain valid JSON');

return;
}

try {
jsonContent = JSON.parse(content);
} catch (e) {
Expand Down

0 comments on commit 79dc880

Please sign in to comment.