{"action":"created","issue":{"url":"https://api.github.com/repos/less/less.js/issues/2599","labels_url":"https://api.github.com/repos/less/less.js/issues/2599/labels{/name}","comments_url":"https://api.github.com/repos/less/less.js/issues/2599/comments","events_url":"https://api.github.com/repos/less/less.js/issues/2599/events","html_url":"https://github.com/less/less.js/issues/2599","id":82175971,"number":2599,"title":"@import (inline, optional) fails with source maps enabled","user":{"login":"mmelvin0","id":762247,"avatar_url":"https://avatars.githubusercontent.com/u/762247?v=3","gravatar_id":"","url":"https://api.github.com/users/mmelvin0","html_url":"https://github.com/mmelvin0","followers_url":"https://api.github.com/users/mmelvin0/followers","following_url":"https://api.github.com/users/mmelvin0/following{/other_user}","gists_url":"https://api.github.com/users/mmelvin0/gists{/gist_id}","starred_url":"https://api.github.com/users/mmelvin0/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mmelvin0/subscriptions","organizations_url":"https://api.github.com/users/mmelvin0/orgs","repos_url":"https://api.github.com/users/mmelvin0/repos","events_url":"https://api.github.com/users/mmelvin0/events{/privacy}","received_events_url":"https://api.github.com/users/mmelvin0/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/less/less.js/labels/Bug","name":"Bug","color":"e10c02"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-05-28T23:49:53Z","updated_at":"2015-06-12T05:33:27Z","closed_at":null,"body":"If I do the following:\r\n\r\n```less\r\n@import (inline, optional) 'file.css';\r\n```\r\n\r\nWhen `file.css` is missing, LESS still tries to generate a source map and fails in `SourceMapOutput.add` since `this._contentsMap[fileInfo.filename]` is `null` for the optional, missing import.\r\n\r\nDisabling source maps (or supplying `file.css`) allows the build to complete successfully."},"comment":{"url":"https://api.github.com/repos/less/less.js/issues/comments/111365907","html_url":"https://github.com/less/less.js/issues/2599#issuecomment-111365907","issue_url":"https://api.github.com/repos/less/less.js/issues/2599","id":111365907,"user":{"login":"lukeapage","id":309321,"avatar_url":"https://avatars.githubusercontent.com/u/309321?v=3","gravatar_id":"","url":"https://api.github.com/users/lukeapage","html_url":"https://github.com/lukeapage","followers_url":"https://api.github.com/users/lukeapage/followers","following_url":"https://api.github.com/users/lukeapage/following{/other_user}","gists_url":"https://api.github.com/users/lukeapage/gists{/gist_id}","starred_url":"https://api.github.com/users/lukeapage/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lukeapage/subscriptions","organizations_url":"https://api.github.com/users/lukeapage/orgs","repos_url":"https://api.github.com/users/lukeapage/repos","events_url":"https://api.github.com/users/lukeapage/events{/privacy}","received_events_url":"https://api.github.com/users/lukeapage/received_events","type":"User","site_admin":false},"created_at":"2015-06-12T05:33:27Z","updated_at":"2015-06-12T05:33:27Z","body":"A simple guard around `this._contentsMap[fileInfo.filename]` might be okay..  That or better,  look at where sourcemap gets its list of fileInfo's and make optional not present imports not add to that list (prob.  In import manager or the import node) "}}