[bugfix] when no settings are given for phases use empty list

This commit is contained in:
Marcel Paffrath 2017-06-30 14:43:06 +02:00
parent 1c610d22f0
commit 8e12bb1bc6

View File

@ -926,8 +926,20 @@ class PickDlg(QDialog):
def addPickPhases(self, menuBar): def addPickPhases(self, menuBar):
settings = QtCore.QSettings() settings = QtCore.QSettings()
phases = {'P': settings.value('p_phases').split(','), p_phases = settings.value('p_phases')
'S': settings.value('s_phases').split(',')} s_phases = settings.value('s_phases')
if p_phases:
p_phases = p_phases.split(',')
else:
p_phases = []
if s_phases:
s_phases = s_phases.split(',')
else:
s_phases = []
phases = {'P': p_phases,
'S': s_phases}
if not 'P' in phases['P'] and not 'p' in phases['P']: if not 'P' in phases['P'] and not 'p' in phases['P']:
phases['P'] = ['P'] + phases['P'] phases['P'] = ['P'] + phases['P']
if not 'S' in phases['S'] and not 's' in phases['S']: if not 'S' in phases['S'] and not 's' in phases['S']: