Skip to content
This repository has been archived by the owner on Nov 18, 2020. It is now read-only.

Commit

Permalink
fixed issue in which listing messages when db is empty throws invalid…
Browse files Browse the repository at this point in the history
… index exception
  • Loading branch information
patrickbaumann committed Sep 14, 2011
1 parent 3a89ac5 commit afcf160
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion geocamTalk/models.py
Expand Up @@ -99,7 +99,10 @@ def getMessages(recipient=None, author=None):


@staticmethod @staticmethod
def getLargestMessageId(): def getLargestMessageId():
return TalkMessage.objects.all().order_by('-pk')[0].pk try:
return TalkMessage.objects.all().order_by('-pk')[0].pk
except:
return 0


def has_audio(self): def has_audio(self):
return bool(self.audio_file != '') return bool(self.audio_file != '')
Expand Down

0 comments on commit afcf160

Please sign in to comment.