We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2c0c387 commit 68f3c60Copy full SHA for 68f3c60
1 file changed
src/React.AspNet.Middleware/AspNetFileSystem.cs
@@ -7,6 +7,7 @@
7
8
using System.IO;
9
using Microsoft.AspNetCore.Hosting;
10
+using React.Exceptions;
11
12
#if NETCOREAPP2_0 || NETSTANDARD2_0
13
using IWebHostEnvironment = Microsoft.AspNetCore.Hosting.IHostingEnvironment;
@@ -38,6 +39,11 @@ public AspNetFileSystem(IWebHostEnvironment hostingEnv)
38
39
/// <returns>Full path of the file</returns>
40
public override string MapPath(string relativePath)
41
{
42
+ if (_hostingEnv.WebRootPath == null)
43
+ {
44
+ throw new ReactException("WebRootPath was null, has the wwwroot folder been deployed along with your app?");
45
+ }
46
+
47
if (relativePath.StartsWith(_hostingEnv.WebRootPath))
48
49
return relativePath;
0 commit comments