summaryrefslogtreecommitdiffstats
path: root/macosx/tkMacOSXMenus.c
diff options
context:
space:
mode:
authorculler <culler>2018-11-11 06:48:07 (GMT)
committerculler <culler>2018-11-11 06:48:07 (GMT)
commitd1d67157b8f5db89f44ecb28e4a06cb6380ae530 (patch)
tree8276ac6cc3f739c814ff1cc1e4af3715ae4deee8 /macosx/tkMacOSXMenus.c
parenta9b367c36191b1de125ece91b539a0160b5cc93f (diff)
downloadtk-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.c6
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));