PR suggestion
This commit is contained in:
1 parent
64b94c58e7
commit
ae200b374b
1 file changed
+11
-10
@@ -154,18 +154,19 @@ namespace mbts.ui {
|
||||
}
|
||||
|
||||
static IEnumerable<string> _get_geometric_path(string geometric_path_key) {
|
||||
object obj;
|
||||
lock (_resources) {
|
||||
object obj = _resources[geometric_path_key];
|
||||
if (obj is string path) {
|
||||
if (string.IsNullOrEmpty(path)) {
|
||||
Log.Api.error($"Resource lookup of '{geometric_path_key}' did not return a valid string.", nameof(geometric_path_key));
|
||||
path = string.Empty;
|
||||
}
|
||||
return new[] { path };
|
||||
} else if (obj is string[] paths) {
|
||||
return paths.Where(p => !string.IsNullOrEmpty(p)).ToArray();
|
||||
} else return null;
|
||||
obj = _resources[geometric_path_key];
|
||||
}
|
||||
if (obj is string path) {
|
||||
if (string.IsNullOrEmpty(path)) {
|
||||
Log.Api.error($"Resource lookup of '{geometric_path_key}' did not return a valid string.", nameof(geometric_path_key));
|
||||
path = string.Empty;
|
||||
}
|
||||
return new[] { path };
|
||||
} else if (obj is string[] paths) {
|
||||
return paths.Where(p => !string.IsNullOrEmpty(p)).ToArray();
|
||||
} else return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user