[MSPAINT] Fix assertion failure on text tool (#5762)

Kill the assertion failure on choosing text tool.
Check whether textEditWindow is not null by using IsWindowVisible.
CORE-19094
This commit is contained in:
Katayama Hirofumi MZ 2023-10-05 19:51:36 +09:00 committed by GitHub
parent d72025649b
commit 3579ea7888
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -762,7 +762,8 @@ struct TextTool : ToolBase
void OnFinishDraw() override
{
if (textEditWindow.GetWindowTextLength() > 0)
if (::IsWindowVisible(textEditWindow) &&
textEditWindow.GetWindowTextLength() > 0)
{
imageModel.PushImageForUndo();
draw(m_hdc);