{"action":"opened","issue":{"url":"https://api.github.com/repos/jscs-dev/node-jscs/issues/1393","labels_url":"https://api.github.com/repos/jscs-dev/node-jscs/issues/1393/labels{/name}","comments_url":"https://api.github.com/repos/jscs-dev/node-jscs/issues/1393/comments","events_url":"https://api.github.com/repos/jscs-dev/node-jscs/issues/1393/events","html_url":"https://github.com/jscs-dev/node-jscs/issues/1393","id":78123239,"number":1393,"title":"Empty switch statement causes TypeError: Cannot read property 'loc' of undefined","user":{"login":"hejmartin","id":1826675,"avatar_url":"https://avatars.githubusercontent.com/u/1826675?v=3","gravatar_id":"","url":"https://api.github.com/users/hejmartin","html_url":"https://github.com/hejmartin","followers_url":"https://api.github.com/users/hejmartin/followers","following_url":"https://api.github.com/users/hejmartin/following{/other_user}","gists_url":"https://api.github.com/users/hejmartin/gists{/gist_id}","starred_url":"https://api.github.com/users/hejmartin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hejmartin/subscriptions","organizations_url":"https://api.github.com/users/hejmartin/orgs","repos_url":"https://api.github.com/users/hejmartin/repos","events_url":"https://api.github.com/users/hejmartin/events{/privacy}","received_events_url":"https://api.github.com/users/hejmartin/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-05-19T14:57:16Z","updated_at":"2015-05-19T14:57:16Z","closed_at":null,"body":"When running jscs on a file that contains an empty switch statement, I get the following error;\r\n```\r\nTypeError: Cannot read property 'loc' of undefined\r\n    at /Users/martin/Sites/magnet-qdp/grunt/node_modules/grunt-jscs/node_modules/jscs/lib/rules/validate-indentation.js:463:58\r\n    at Array.forEach (native)\r\n    at Object.JsFile.iterateNodesByType (/Users/martin/Sites/magnet-qdp/grunt/node_modules/grunt-jscs/node_modules/jscs/lib/js-file.js:426:42)\r\n    at generateIndentations (/Users/martin/Sites/magnet-qdp/grunt/node_modules/grunt-jscs/node_modules/jscs/lib/rules/validate-indentation.js:455:18)\r\n    at Object.module.exports.check (/Users/martin/Sites/magnet-qdp/grunt/node_modules/grunt-jscs/node_modules/jscs/lib/rules/validate-indentation.js:557:9)\r\n    at null.<anonymous> (/Users/martin/Sites/magnet-qdp/grunt/node_modules/grunt-jscs/node_modules/jscs/lib/string-checker.js:141:22)\r\n    at Array.forEach (native)\r\n    at StringChecker._checkJsFile (/Users/martin/Sites/magnet-qdp/grunt/node_modules/grunt-jscs/node_modules/jscs/lib/string-checker.js:137:31)\r\n    at StringChecker.fixString (/Users/martin/Sites/magnet-qdp/grunt/node_modules/grunt-jscs/node_modules/jscs/lib/string-checker.js:244:22)\r\n    at null.<anonymous> (/Users/martin/Sites/magnet-qdp/grunt/node_modules/grunt-jscs/node_modules/jscs/lib/checker.js:59:27)\r\n```\r\nI can recreate this issue with a file containing nothing but this:\r\n```javascript\r\nswitch (1) {}\r\n```\r\nIdeally, of course I shouldn't have any empty switch statements in my code: But it took me a while to find what in a file with 300 lines of code caused the error, as the entire task crashed and only named the file it occurred in but not why or where, so a better error message here would be much welcome.\r\n\r\nI'm using jscs 1.13.1 via grunt-jscs 1.8.0 on Mac OS X 10.10.3 running node 0.10.4"}}