Skip players with unparseable UUIDs

This commit is contained in:
David Vierra 2015-03-18 23:42:25 -10:00
parent 087f6e153b
commit 09b2884086

View File

@ -55,9 +55,14 @@ class PlayerPanel(QtGui.QWidget):
displayName = "[Single-player](%s)" % singlePlayerUUID
else:
displayName = UUID # xxx mojang api here
UUID = uuid.UUID(hex=UUID)
if UUID == singlePlayerUUID:
continue # Don't count single-player twice when it appears under playerData/
try:
UUID = uuid.UUID(hex=UUID)
if UUID == singlePlayerUUID:
continue # Don't count single-player twice when it appears under playerData/
except ValueError: # badly formed uuid?
log.warn("Could not get a UUID from %s", UUID)
continue
self.playerListBox.addItem(displayName, UUID)
self.playerListBox.currentIndexChanged[int].connect(self.setSelectedPlayerIndex)