Skip to content

Commit abc5aa0

Browse files
committed
guard against null strings with non-zero size
1 parent 6c4d7d5 commit abc5aa0

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/unrealsdk/unreal/structs/fstring.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,10 @@ UnmanagedFString::operator std::wstring() const {
7474
return std::wstring{this->operator std::wstring_view()};
7575
}
7676
UnmanagedFString::operator std::wstring_view() const {
77+
// You'd think data == nullptr implies size == 0, but occasionally during game shutdown I've
78+
// seen otherwise.
7779
auto size = this->size();
78-
if (size == 0) {
80+
if (size == 0 || this->data == nullptr) {
7981
return L"";
8082
}
8183

0 commit comments

Comments
 (0)