{"action":"created","issue":{"url":"https://api.github.com/repos/Ovyerus/redite/issues/1","repository_url":"https://api.github.com/repos/Ovyerus/redite","labels_url":"https://api.github.com/repos/Ovyerus/redite/issues/1/labels{/name}","comments_url":"https://api.github.com/repos/Ovyerus/redite/issues/1/comments","events_url":"https://api.github.com/repos/Ovyerus/redite/issues/1/events","html_url":"https://github.com/Ovyerus/redite/issues/1","id":273217693,"number":1,"title":"Deeply nested setting breaks.","user":{"login":"Ovyerus","id":18654005,"avatar_url":"https://avatars0.githubusercontent.com/u/18654005?v=4","gravatar_id":"","url":"https://api.github.com/users/Ovyerus","html_url":"https://github.com/Ovyerus","followers_url":"https://api.github.com/users/Ovyerus/followers","following_url":"https://api.github.com/users/Ovyerus/following{/other_user}","gists_url":"https://api.github.com/users/Ovyerus/gists{/gist_id}","starred_url":"https://api.github.com/users/Ovyerus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ovyerus/subscriptions","organizations_url":"https://api.github.com/users/Ovyerus/orgs","repos_url":"https://api.github.com/users/Ovyerus/repos","events_url":"https://api.github.com/users/Ovyerus/events{/privacy}","received_events_url":"https://api.github.com/users/Ovyerus/received_events","type":"User","site_admin":false},"labels":[{"id":747912945,"url":"https://api.github.com/repos/Ovyerus/redite/labels/bug","name":"bug","color":"ee0701","default":true}],"state":"open","locked":false,"assignee":{"login":"Ovyerus","id":18654005,"avatar_url":"https://avatars0.githubusercontent.com/u/18654005?v=4","gravatar_id":"","url":"https://api.github.com/users/Ovyerus","html_url":"https://github.com/Ovyerus","followers_url":"https://api.github.com/users/Ovyerus/followers","following_url":"https://api.github.com/users/Ovyerus/following{/other_user}","gists_url":"https://api.github.com/users/Ovyerus/gists{/gist_id}","starred_url":"https://api.github.com/users/Ovyerus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ovyerus/subscriptions","organizations_url":"https://api.github.com/users/Ovyerus/orgs","repos_url":"https://api.github.com/users/Ovyerus/repos","events_url":"https://api.github.com/users/Ovyerus/events{/privacy}","received_events_url":"https://api.github.com/users/Ovyerus/received_events","type":"User","site_admin":false},"assignees":[{"login":"Ovyerus","id":18654005,"avatar_url":"https://avatars0.githubusercontent.com/u/18654005?v=4","gravatar_id":"","url":"https://api.github.com/users/Ovyerus","html_url":"https://github.com/Ovyerus","followers_url":"https://api.github.com/users/Ovyerus/followers","following_url":"https://api.github.com/users/Ovyerus/following{/other_user}","gists_url":"https://api.github.com/users/Ovyerus/gists{/gist_id}","starred_url":"https://api.github.com/users/Ovyerus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ovyerus/subscriptions","organizations_url":"https://api.github.com/users/Ovyerus/orgs","repos_url":"https://api.github.com/users/Ovyerus/repos","events_url":"https://api.github.com/users/Ovyerus/events{/privacy}","received_events_url":"https://api.github.com/users/Ovyerus/received_events","type":"User","site_admin":false}],"milestone":null,"comments":0,"created_at":"2017-11-12T10:08:32Z","updated_at":"2017-11-14T09:28:55Z","closed_at":null,"author_association":"OWNER","body":"Recently, the method used to set a deeply nested key in a list or hash, broke.\r\n\r\n(redite.js, lines 243-249)\r\n```js\r\nstack.slice(2, -1).forEach(key => {\r\n    if (!ref.hasOwnProperty(key)) ref[key] = /^[0-9]+$/.test(key) ? [] : {};\r\n    ref = ref[key];\r\n});\r\n\r\nref[stack.slice(-1)[0]] = value; // Set the final nested value.\r\n```\r\n\r\nThis ends up with `TypeError: Cannot read property 'bar' of null`."},"comment":{"url":"https://api.github.com/repos/Ovyerus/redite/issues/comments/344197002","html_url":"https://github.com/Ovyerus/redite/issues/1#issuecomment-344197002","issue_url":"https://api.github.com/repos/Ovyerus/redite/issues/1","id":344197002,"user":{"login":"Ovyerus","id":18654005,"avatar_url":"https://avatars0.githubusercontent.com/u/18654005?v=4","gravatar_id":"","url":"https://api.github.com/users/Ovyerus","html_url":"https://github.com/Ovyerus","followers_url":"https://api.github.com/users/Ovyerus/followers","following_url":"https://api.github.com/users/Ovyerus/following{/other_user}","gists_url":"https://api.github.com/users/Ovyerus/gists{/gist_id}","starred_url":"https://api.github.com/users/Ovyerus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ovyerus/subscriptions","organizations_url":"https://api.github.com/users/Ovyerus/orgs","repos_url":"https://api.github.com/users/Ovyerus/repos","events_url":"https://api.github.com/users/Ovyerus/events{/privacy}","received_events_url":"https://api.github.com/users/Ovyerus/received_events","type":"User","site_admin":false},"created_at":"2017-11-14T09:28:55Z","updated_at":"2017-11-14T09:28:55Z","author_association":"OWNER","body":"Update: managed to fix the TypeError by messing around elsewhere, however it still doesn't work as intended.  \r\nInstead, it now somehow ends up splitting the tree up into multiple objects, like so\r\n```\r\n{ foo: { bar: { foobar: {} } },\r\n  bar: { foobar: { TEST_HASH: 'TEST HASH' } } }\r\n```\r\nand\r\n```\r\n{ foo: { bar: { foobar: {} } },\r\n  bar: { foobar: { TEST_HASH: 'TEST HASH' } } }\r\n```"}}
{"actor":{"display_login":"Ovyerus"}}