Skip to content

Commit

Permalink
Avoid possible IndexError
Browse files Browse the repository at this point in the history
It looks like a bug.
  • Loading branch information
WouldYouKindly authored Mar 3, 2018
1 parent a3a2651 commit f112f97
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/protocol.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class ClientPacketTypes(object):

@classmethod
def to_str(cls, packet):
return 'Unknown packet' if packet > 6 else cls._types_str[packet]
return 'Unknown packet' if packet > 5 else cls._types_str[packet]


class ServerPacketTypes(object):
Expand Down Expand Up @@ -73,7 +73,7 @@ class ServerPacketTypes(object):

@classmethod
def to_str(cls, packet):
return 'Unknown packet' if packet > 10 else cls._types_str[packet]
return 'Unknown packet' if packet > 9 else cls._types_str[packet]


class Compression(object):
Expand Down

0 comments on commit f112f97

Please sign in to comment.