diff options
author | culler <culler> | 2018-11-11 06:48:07 (GMT) |
---|---|---|
committer | culler <culler> | 2018-11-11 06:48:07 (GMT) |
commit | d1d67157b8f5db89f44ecb28e4a06cb6380ae530 (patch) | |
tree | 8276ac6cc3f739c814ff1cc1e4af3715ae4deee8 /macosx/tkMacOSXMenus.c | |
parent | a9b367c36191b1de125ece91b539a0160b5cc93f (diff) | |
download | tk-d1d67157b8f5db89f44ecb28e4a06cb6380ae530.zip tk-d1d67157b8f5db89f44ecb28e4a06cb6380ae530.tar.gz tk-d1d67157b8f5db89f44ecb28e4a06cb6380ae530.tar.bz2 |
Always check whether the return value of TkMacOSXGetTkWindow is NULL.
Diffstat (limited to 'macosx/tkMacOSXMenus.c')
-rw-r--r-- | macosx/tkMacOSXMenus.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/macosx/tkMacOSXMenus.c b/macosx/tkMacOSXMenus.c index f8f00a6..15dbad4 100644 --- a/macosx/tkMacOSXMenus.c +++ b/macosx/tkMacOSXMenus.c @@ -379,13 +379,13 @@ GenerateEditEvent( XVirtualEvent event; int x, y; TkWindow *winPtr = TkMacOSXGetTkWindow([NSApp keyWindow]); - Tk_Window tkwin = (Tk_Window) winPtr; + Tk_Window tkwin; - if (tkwin == NULL) { + if (!winPtr) { return; } tkwin = (Tk_Window) winPtr->dispPtr->focusPtr; - if (tkwin == NULL) { + if (!tkwin) { return; } bzero(&event, sizeof(XVirtualEvent)); |