From 68c7aa7ff1131fd1189705bdbbdbde778b809e11 Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Tue, 12 May 2009 19:36:09 +0000 Subject: [PATCH] Fix invalid pop up widget selection, when no "opl_driver" setting is present. svn-id: r40506 --- gui/options.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/gui/options.cpp b/gui/options.cpp index c152a3a2668..da9a5cecf50 100644 --- a/gui/options.cpp +++ b/gui/options.cpp @@ -183,8 +183,10 @@ void OptionsDialog::open() { _midiPopUp->setSelectedTag(id); } - if (_oplPopUp) - _oplPopUp->setSelectedTag(OPL::Config::parse(ConfMan.get("opl_driver", _domain))); + if (_oplPopUp) { + OPL::Config::DriverId id = MAX(OPL::Config::parse(ConfMan.get("opl_driver", _domain)), 0); + _oplPopUp->setSelectedTag(id); + } if (_outputRatePopUp) { _outputRatePopUp->setSelected(1);