diff --git a/src/zstring.cpp b/src/zstring.cpp index ff17fd607..565de8753 100644 --- a/src/zstring.cpp +++ b/src/zstring.cpp @@ -996,6 +996,7 @@ void FString::Substitute (const char *oldstr, const char *newstr) void FString::Substitute (const char *oldstr, const char *newstr, size_t oldstrlen, size_t newstrlen) { + if (oldstr == nullptr || newstr == nullptr || *oldstr == 0) return; LockBuffer(); for (size_t checkpt = 0; checkpt < Len(); ) {