Skip to content

Commit d8f86c6

Browse files
committed
FileResourceHandler - Throw exception if file not found
CEF expects files to exist
1 parent 7a0b06a commit d8f86c6

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

CefSharp/Internals/FileResourceHandler.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,7 @@
33
// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
44

55
using System;
6-
using System.Collections.Generic;
7-
using System.Collections.Specialized;
86
using System.IO;
9-
using System.Text;
107

118
namespace CefSharp
129
{
@@ -46,6 +43,10 @@ public FileResourceHandler(string mimeType, string filePath)
4643
throw new ArgumentNullException("filePath", "Please provide a valid filePath");
4744
}
4845

46+
if(!File.Exists(filePath))
47+
{
48+
throw new FileNotFoundException("Unable to create FileResourceHandler", filePath);
49+
}
4950

5051
MimeType = mimeType;
5152
FilePath = filePath;

0 commit comments

Comments
 (0)