Skip to content

Commit

Permalink
csharp: fix - "Path not found" - error handled
Browse files Browse the repository at this point in the history
  • Loading branch information
rivexe committed Feb 17, 2023
1 parent 54f501c commit 63b7641
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions web/documentserver-example/csharp/WebEditor.ashx.cs
Original file line number Diff line number Diff line change
Expand Up @@ -451,11 +451,18 @@ private static void Reference(HttpContext context)

if (fileName == "" && userAddress != "")
{
var path = (string)body["path"];
path = Path.GetFileName(path);
if (File.Exists(_Default.StoragePath(path, userAddress)))
try
{
fileName = path;
var path = (string)body["path"];
path = Path.GetFileName(path);
if (File.Exists(_Default.StoragePath(path, userAddress)))
{
fileName = path;
}
}
catch {
context.Response.Write("{ \"error\": \"Path not found!\"}");
return;
}
}

Expand Down

0 comments on commit 63b7641

Please sign in to comment.