Skip to content

Commit e84bd60

Browse files
committed
ISystem check if directory or not
1 parent cdbd33c commit e84bd60

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/nbl/system/ISystem.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,15 +114,15 @@ bool ISystem::createDirectory(const system::path& p)
114114

115115
bool ISystem::deleteDirectory(const system::path& p)
116116
{
117-
if (std::filesystem::exists(p))
117+
if (std::filesystem::exists(p) && std::filesystem::is_directory(p))
118118
return std::filesystem::remove_all(p);
119119
else
120120
return false;
121121
}
122122

123123
bool nbl::system::ISystem::deleteFile(const system::path& p)
124124
{
125-
if (std::filesystem::exists(p))
125+
if (std::filesystem::exists(p) && !std::filesystem::is_directory(p)))
126126
return std::filesystem::remove(p);
127127
else
128128
return false;

0 commit comments

Comments
 (0)