From 1b6ce4861f0d2326416bfa7315a1832d2bced85e Mon Sep 17 00:00:00 2001 From: Eric House Date: Sun, 28 Jun 2015 09:00:41 -0700 Subject: [PATCH] don't crash when invitation dialog cancelled --- xwords4/linux/gtkaskm.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/xwords4/linux/gtkaskm.c b/xwords4/linux/gtkaskm.c index c251eb8a0..aef7ef644 100644 --- a/xwords4/linux/gtkaskm.c +++ b/xwords4/linux/gtkaskm.c @@ -74,12 +74,13 @@ gtkaskm( const gchar* message, AskMInfo* infos, int nInfos ) gtk_main(); - if ( !state.cancelled ) { - for ( ii = 0; ii < nInfos; ++ii ) { + for ( ii = 0; ii < nInfos; ++ii ) { + AskMInfo* info = &infos[ii]; + if ( !state.cancelled ) { const gchar* txt = gtk_entry_get_text( GTK_ENTRY(fields[ii]) ); XP_LOGF( "%s: got text %s", __func__, txt ); - AskMInfo* info = &infos[ii]; - *info->result = g_strdup( txt ); + } else { + *info->result = NULL; } }