mirror of https://github.com/yuzu-mirror/yuzu
common/file_util: Make GetCurrentDir() return a std::optional
nullptr was being returned in the error case, which, at a glance may seem perfectly OK... until you realize that std::string has the invariant that it may not be constructed from a null pointer. This means that if this error case was ever hit, then the application would most likely crash from a thrown exception in std::string's constructor. Instead, we can change the function to return an optional value, indicating if a failure occurred.pull/8/head
parent
943f6da1ac
commit
11e9bee91d
Loading…
Reference in New Issue