Added conditional exceptions.

This commit is contained in:
BDisp
2020-08-07 13:49:08 +01:00
parent 4d5713e269
commit ffd15972ae

View File

@@ -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 ();