From fdb28eb0c4190ceccf4372f7289b1cd9de444a2c Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Thu, 23 Apr 2020 17:10:12 +0200 Subject: [PATCH] fs/NarrowPath: preserve nullptr in Path operator Fixes Path::IsNull() checks on Windows. --- src/fs/NarrowPath.hxx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/fs/NarrowPath.hxx b/src/fs/NarrowPath.hxx index 48198ffbf..55756e983 100644 --- a/src/fs/NarrowPath.hxx +++ b/src/fs/NarrowPath.hxx @@ -90,6 +90,11 @@ public: constexpr #endif operator Path() const noexcept { +#ifdef _UNICODE + if (value.IsNull()) + return nullptr; +#endif + return value; } };