Skip to content

Commit 6f7c7ac

Browse files
authored
Merge pull request #1047 from Mr-Rm/fix-973
fix #973: недоступный по любой причине файл считать несуществующим
2 parents d14e226 + 9c8516f commit 6f7c7ac

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

src/ScriptEngine.HostedScript/Library/FileContext.cs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -118,17 +118,17 @@ public bool Exist()
118118
try
119119
{
120120
File.GetAttributes(FullName);
121+
return true;
121122
}
122-
catch (FileNotFoundException)
123-
{
124-
return false;
125-
}
126-
catch (DirectoryNotFoundException)
127-
{
128-
return false;
129-
}
130-
131-
return true;
123+
catch (FileNotFoundException) { }
124+
catch (DirectoryNotFoundException) { }
125+
catch (ArgumentException) { }
126+
catch (NotSupportedException) { }
127+
catch (PathTooLongException) { }
128+
catch (UnauthorizedAccessException) { }
129+
catch (IOException) { }
130+
131+
return false;
132132
}
133133

134134
[ContextMethod("Размер", "Size")]

0 commit comments

Comments
 (0)