Skip to content
This repository has been archived by the owner on Mar 15, 2018. It is now read-only.

Commit

Permalink
beware of invalid platforms
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeff Balogh committed Nov 12, 2010
1 parent 499d239 commit 57c4a67
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion apps/files/models.py
Expand Up @@ -158,7 +158,11 @@ class Meta(amo.models.ModelBase.Meta):
db_table = 'platforms'

def __unicode__(self):
return unicode(amo.PLATFORMS[self.id].name)
if self.id in amo.PLATFORMS:
return unicode(amo.PLATFORMS[self.id].name)
else:
log.warning('Invalid platform')
return ''


class FileUpload(amo.models.ModelBase):
Expand Down

0 comments on commit 57c4a67

Please sign in to comment.