mirror of
https://github.com/abraunegg/onedrive
synced 2024-05-15 20:26:53 +02:00
correct way to test if a value is in the AA
This commit is contained in:
parent
3489827431
commit
7afae8fbb8
|
@ -18,10 +18,10 @@ struct Config
|
|||
|
||||
string get(string key)
|
||||
{
|
||||
import core.exception;
|
||||
try {
|
||||
return values[key];
|
||||
} catch (RangeError e) {
|
||||
auto p = key in values;
|
||||
if (p) {
|
||||
return *p;
|
||||
} else {
|
||||
throw new Exception("Missing config value: " ~ key);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue