diff --git a/src_main/io_devices/piconfig.h b/src_main/io_devices/piconfig.h index b53a180b..21a016e0 100755 --- a/src_main/io_devices/piconfig.h +++ b/src_main/io_devices/piconfig.h @@ -526,15 +526,13 @@ inline PICout operator <<(PICout s, const PIConfig::Entry & v) {s << v.value(); template T readDeviceSetting(const PIString & name, const T & def, const PIConfig::Entry * em, const PIConfig::Entry * ep) { PIVariant v = PIVariant::fromValue(def); - if (ep) { + if (ep != 0) { bool ex = false; - PIString sv = ep->getValue(name, def, &ex).toString(); - if (!ex) - return def; - v.setValueFromString(sv); - return v.value(); + v.setValueFromString(ep->getValue(name, def, &ex).toString()); + if (ex) return v.value(); } - return def; + v.setValueFromString(em->getValue(name, def).toString()); + return v.value(); } #endif // PICONFIG_H