{"action":"created","issue":{"url":"https://api.github.com/repos/crorella/hots-parser/issues/30","repository_url":"https://api.github.com/repos/crorella/hots-parser","labels_url":"https://api.github.com/repos/crorella/hots-parser/issues/30/labels{/name}","comments_url":"https://api.github.com/repos/crorella/hots-parser/issues/30/comments","events_url":"https://api.github.com/repos/crorella/hots-parser/issues/30/events","html_url":"https://github.com/crorella/hots-parser/pull/30","id":136213777,"number":30,"title":"Avoid out of index error by checking ownerList size first","user":{"login":"ajbdev","id":572055,"avatar_url":"https://avatars.githubusercontent.com/u/572055?v=3","gravatar_id":"","url":"https://api.github.com/users/ajbdev","html_url":"https://github.com/ajbdev","followers_url":"https://api.github.com/users/ajbdev/followers","following_url":"https://api.github.com/users/ajbdev/following{/other_user}","gists_url":"https://api.github.com/users/ajbdev/gists{/gist_id}","starred_url":"https://api.github.com/users/ajbdev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ajbdev/subscriptions","organizations_url":"https://api.github.com/users/ajbdev/orgs","repos_url":"https://api.github.com/users/ajbdev/repos","events_url":"https://api.github.com/users/ajbdev/events{/privacy}","received_events_url":"https://api.github.com/users/ajbdev/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2016-02-24T22:55:18Z","updated_at":"2016-02-25T00:32:32Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/crorella/hots-parser/pulls/30","html_url":"https://github.com/crorella/hots-parser/pull/30","diff_url":"https://github.com/crorella/hots-parser/pull/30.diff","patch_url":"https://github.com/crorella/hots-parser/pull/30.patch"},"body":"I was getting the following error on a random Garden of Terror replay:\r\n\r\n```\r\nTraceback (most recent call last):\r\n  File \"main.py\", line 277, in <module>\r\n    replayData = processEvents(protocol, replay)\r\n  File \"/Users/andybaird/hots-parser/parser.py\", line 21, in processEvents\r\n    replay_data.process_replay()\r\n  File \"/Users/andybaird/hots-parser/replay/__init__.py\", line 103, in process_replay\r\n    self.process_event(event)\r\n  File \"/Users/andybaird/hots-parser/replay/__init__.py\", line 118, in process_event\r\n    getattr(self, event_name)(event)\r\n  File \"/Users/andybaird/hots-parser/replay/__init__.py\", line 1251, in NNet_Replay_Tracker_SUnitDiedEvent\r\n    self.get_unit_destruction(event)\r\n  File \"/Users/andybaird/hots-parser/replay/__init__.py\", line 686, in get_unit_destruction\r\n    self.unitsInGame[deadUnitTag].ownerList[0][1]\r\nIndexError: list index out of range\r\n```\r\n\r\n\r\nThis is a quick and dirty fix to prevent the error, but this probably doesn't fix the root problem. Feel free to reject this PR, but I thought I'd provide it just in case. "},"comment":{"url":"https://api.github.com/repos/crorella/hots-parser/issues/comments/188534217","html_url":"https://github.com/crorella/hots-parser/pull/30#issuecomment-188534217","issue_url":"https://api.github.com/repos/crorella/hots-parser/issues/30","id":188534217,"user":{"login":"crorella","id":2134089,"avatar_url":"https://avatars.githubusercontent.com/u/2134089?v=3","gravatar_id":"","url":"https://api.github.com/users/crorella","html_url":"https://github.com/crorella","followers_url":"https://api.github.com/users/crorella/followers","following_url":"https://api.github.com/users/crorella/following{/other_user}","gists_url":"https://api.github.com/users/crorella/gists{/gist_id}","starred_url":"https://api.github.com/users/crorella/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/crorella/subscriptions","organizations_url":"https://api.github.com/users/crorella/orgs","repos_url":"https://api.github.com/users/crorella/repos","events_url":"https://api.github.com/users/crorella/events{/privacy}","received_events_url":"https://api.github.com/users/crorella/received_events","type":"User","site_admin":false},"created_at":"2016-02-25T00:32:32Z","updated_at":"2016-02-25T00:32:32Z","body":"I was checking the replay and the cause seems to be there is a missing SUnitOwnerChangeEvent for that plant. I'll see if I can get that value from the new events. Anyways looks like an error with the replay itself."}}