From a8478dbe72692ec39e87ed86d2557f6490bb7c87 Mon Sep 17 00:00:00 2001 From: fvogel Date: Sun, 28 May 2023 18:00:38 +0000 Subject: Third patch from Christopher Chavez. --- macosx/tkMacOSXEmbed.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/macosx/tkMacOSXEmbed.c b/macosx/tkMacOSXEmbed.c index 9a03178..72f2870 100644 --- a/macosx/tkMacOSXEmbed.c +++ b/macosx/tkMacOSXEmbed.c @@ -476,6 +476,10 @@ TkMacOSXGetHostToplevel( { TkWindow *contWinPtr, *topWinPtr; + if (!(winPtr && winPtr->privatePtr)) { + return NULL; + } + topWinPtr = winPtr->privatePtr->toplevel->winPtr; if (!Tk_IsEmbedded(topWinPtr)) { return winPtr->privatePtr->toplevel; @@ -486,9 +490,6 @@ TkMacOSXGetHostToplevel( * TODO: Here we should handle out of process embedding. */ - if (!contWinPtr) { - return NULL; - } return TkMacOSXGetHostToplevel(contWinPtr); } @@ -700,7 +701,7 @@ TkpGetOtherWindow( * process... */ - if (!(winPtr->flags & TK_BOTH_HALVES)) { + if (!(winPtr && (winPtr->flags & TK_BOTH_HALVES))) { return NULL; } -- cgit v0.12