mirror of
https://github.com/gui-cs/Terminal.Gui.git
synced 2025-12-29 17:28:01 +01:00
Added conditional exceptions.
This commit is contained in:
@@ -57,8 +57,18 @@ namespace Terminal.Gui {
|
||||
top = 0;
|
||||
selected = 0;
|
||||
valid = true;
|
||||
} catch (Exception) {
|
||||
valid = false;
|
||||
} catch (Exception ex) {
|
||||
switch (ex) {
|
||||
case DirectoryNotFoundException _:
|
||||
case ArgumentException _:
|
||||
dirInfo = null;
|
||||
infos.Clear ();
|
||||
valid = true;
|
||||
break;
|
||||
default:
|
||||
valid = false;
|
||||
break;
|
||||
}
|
||||
} finally {
|
||||
if (valid) {
|
||||
SetNeedsDisplay ();
|
||||
|
||||
Reference in New Issue
Block a user