From f99bc3e0fe54a8880d7942ec9281a4826a682076 Mon Sep 17 00:00:00 2001 From: Alex Barney Date: Mon, 11 Nov 2019 12:03:22 -0600 Subject: [PATCH] Give a better error in LocalFileSystem when trying to initialize it with a file --- src/LibHac/FsSystem/LocalFileSystem.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/LibHac/FsSystem/LocalFileSystem.cs b/src/LibHac/FsSystem/LocalFileSystem.cs index a6372069..f9a98c8e 100644 --- a/src/LibHac/FsSystem/LocalFileSystem.cs +++ b/src/LibHac/FsSystem/LocalFileSystem.cs @@ -21,6 +21,11 @@ namespace LibHac.FsSystem if (!Directory.Exists(BasePath)) { + if (File.Exists(BasePath)) + { + throw new DirectoryNotFoundException($"The specified path is a file. ({basePath})"); + } + Directory.CreateDirectory(BasePath); } }