core: fixed crash on first run, when no profile exist yet
fix bug 24
This commit is contained in:
parent
4d08b7f72e
commit
67ff0610e5
1 changed files with 5 additions and 1 deletions
|
|
@ -189,7 +189,11 @@ class Params(object):
|
|||
default = self.host.memory.memory_data.get('Profile_default')
|
||||
if not default:
|
||||
info(_('No default profile, returning first one')) # TODO: manage real default profile
|
||||
default = self.host.memory.memory_data['Profile_default'] = self.storage.getProfilesList()[0]
|
||||
try:
|
||||
default = self.host.memory.memory_data['Profile_default'] = self.storage.getProfilesList()[0]
|
||||
except IndexError:
|
||||
info(_('No profile exist yet'))
|
||||
return ""
|
||||
return default # FIXME: temporary, must use real default value, and fallback to first one if it doesn't exists
|
||||
if not self.storage.hasProfile(profile_key):
|
||||
info(_('Trying to access an unknown profile'))
|
||||
|
|
|
|||
Loading…
Reference in a new issue