diff --git a/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIEditBoxMod.cpp b/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIEditBoxMod.cpp index 03444783..66b8c3db 100644 --- a/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIEditBoxMod.cpp +++ b/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIEditBoxMod.cpp @@ -511,18 +511,23 @@ hsBool pfGUIEditBoxMod::HandleKeyEvent( pfGameGUIMgr::EventType event, plKeyDef else if (key == KEY_V) { wchar_t* contents = plClipboard::GetInstance().GetClipboardText(); - size_t len = wcslen(contents); - if (len > 0) { - wchar_t* insertTarget = fBuffer + fCursorPos; - size_t bufferTailLen = wcslen(insertTarget); - if (fCursorPos + len + bufferTailLen < fBufferSize) { - memmove(insertTarget + len, insertTarget, bufferTailLen * sizeof(wchar_t)); - memcpy(insertTarget, contents, len * sizeof(wchar_t)); - fCursorPos += len; - HandleExtendedEvent( kValueChanging ); + if (contents != nil) + { + size_t len = wcslen(contents); + if (len > 0) + { + wchar_t* insertTarget = fBuffer + fCursorPos; + size_t bufferTailLen = wcslen(insertTarget); + if (fCursorPos + len + bufferTailLen < fBufferSize) + { + memmove(insertTarget + len, insertTarget, bufferTailLen * sizeof(wchar_t)); + memcpy(insertTarget, contents, len * sizeof(wchar_t)); + fCursorPos += len; + HandleExtendedEvent( kValueChanging ); + } } + delete contents; } - delete contents; } } else diff --git a/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIMultiLineEditCtrl.cpp b/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIMultiLineEditCtrl.cpp index 60b8c354..9d5df62a 100644 --- a/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIMultiLineEditCtrl.cpp +++ b/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIMultiLineEditCtrl.cpp @@ -1226,8 +1226,11 @@ hsBool pfGUIMultiLineEditCtrl::HandleKeyEvent( pfGameGUIMgr::EventType event, pl else if (key == KEY_V) { wchar_t* contents = plClipboard::GetInstance().GetClipboardText(); - InsertString(contents); - delete contents; + if (contents != nil) + { + InsertString(contents); + delete contents; + } } } else