Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

None in game events #188

Open
StoicLoofah opened this issue Sep 12, 2015 · 0 comments
Open

None in game events #188

StoicLoofah opened this issue Sep 12, 2015 · 0 comments

Comments

@StoicLoofah
Copy link

I got this error with this replay

http://lotv.spawningtool.com/2178/download/

>>> import sc2reader
>>> sc2reader.load_replay('replays/beta/asl.SC2Replay')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/kevin/sc2reader/sc2reader/factories/sc2factory.py", line 85, in load_replay
    return self.load(Replay, source, options, **new_options)
  File "/home/kevin/sc2reader/sc2reader/factories/sc2factory.py", line 137, in load
    return self._load(cls, resource, filename=filename, options=options)
  File "/home/kevin/sc2reader/sc2reader/factories/sc2factory.py", line 146, in _load
    obj = cls(resource, filename=filename, factory=self, **options)
  File "/home/kevin/sc2reader/sc2reader/resources.py", line 299, in __init__
    self.load_game_events()
  File "/home/kevin/sc2reader/sc2reader/resources.py", line 509, in load_game_events
    self.events = sorted(self.events+self.game_events, key=lambda e: e.frame)
  File "/home/kevin/sc2reader/sc2reader/resources.py", line 509, in <lambda>
    self.events = sorted(self.events+self.game_events, key=lambda e: e.frame)
AttributeError: 'NoneType' object has no attribute 'frame'

I think the fix is just to add this just before here

self.game_events = [event for event in self.game_events if event is not None]

I can open a PR for this, but I"m not sure this ist he right thing to do, and I would prefer to merge it onto the lotv branch, but that one hasn't been merged yet

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant