From 6234f252268f04c8907aafe1e5faf29c2538973b Mon Sep 17 00:00:00 2001 From: David Vierra Date: Thu, 23 Mar 2017 14:27:36 -1000 Subject: [PATCH] Fix #307 - Nonsense value for LastPlayed? --- src/mcedit2/worldlist.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/mcedit2/worldlist.py b/src/mcedit2/worldlist.py index 083bdd8..f9c29cf 100644 --- a/src/mcedit2/worldlist.py +++ b/src/mcedit2/worldlist.py @@ -70,7 +70,12 @@ class WorldListItemWidget(QtGui.QWidget): def setWorldInfo(self, (name, lastPlayed, versionInfo)): self.displayNameLabel.setText(name) if lastPlayed: - lastPlayedText = arrow.Arrow.fromtimestamp(lastPlayed / 1000.0).humanize() + try: + lastPlayedText = arrow.Arrow.fromtimestamp(lastPlayed / 1000.0).humanize() + except ValueError: + # Nonsense value for LastPlayed? + lastPlayedText = "Unknown (Timestamp %s)" % (lastPlayed / 1000.0,) + self.lastPlayedLabel.setText(lastPlayedText) else: self.lastPlayedLabel.setText("")