From a5738d75bc43bcfcf0d5f4d80437b32f09949650 Mon Sep 17 00:00:00 2001 From: Linas Vepstas Date: Wed, 26 Nov 1997 21:35:43 +0000 Subject: [PATCH] fix core dump git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@151 57a11ea4-9604-0410-9ed3-97b8803252fd --- src/PopBox.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/PopBox.c b/src/PopBox.c index 0c23fd1250..24907b3487 100644 --- a/src/PopBox.c +++ b/src/PopBox.c @@ -189,10 +189,15 @@ static void selectCB (Widget w, XtPointer cd, XtPointer cb ) PopBox *ab = (PopBox *) cd; XmComboBoxSelectionCallbackStruct *selection = (XmComboBoxSelectionCallbackStruct *) cb; - char * choice; - - choice = XmCvtXmStringToCT (selection->value); - if (0x0 == choice) choice = ""; + char * choice = 0x0; + + /* check the reason, because the unslect callback + * doesn't even have a value field! */ + if ( (XmCR_SINGLE_SELECT == selection->reason) || + (XmCR_SINGLE_SELECT == selection->reason) ) { + choice = XmCvtXmStringToCT (selection->value); + } + if (!choice) choice = ""; XbaeMatrixSetCell (ab->reg, ab->currow, ab->curcol, choice);