Prevent crash when there's an error loading a qif import file.

This commit is contained in:
John Ralls 2016-12-03 17:50:38 -08:00
parent 27f529e76a
commit 755c42a087

View File

@ -1698,7 +1698,7 @@ gnc_ui_qif_import_load_progress_start_cb(GtkButton * button,
SCM parse_results = scm_c_eval_string("qif-file:parse-fields-results"); SCM parse_results = scm_c_eval_string("qif-file:parse-fields-results");
SCM scm_qiffile; SCM scm_qiffile;
SCM imported_files = SCM_EOL; SCM imported_files = SCM_EOL;
SCM load_return, parse_return; SCM load_return = SCM_BOOL_F, parse_return = SCM_BOOL_F;
SCM progress; SCM progress;
/* Raise the busy flag so the assistant can't be canceled unexpectedly. */ /* Raise the busy flag so the assistant can't be canceled unexpectedly. */
@ -1804,11 +1804,15 @@ gnc_ui_qif_import_load_progress_start_cb(GtkButton * button,
*/ */
/* This step will fill the remainder of the bar. */ /* This step will fill the remainder of the bar. */
gnc_progress_dialog_push(wind->load_progress, 1); if (!wind->load_stop)
parse_return = scm_call_2(qif_file_parse, SCM_CAR(imported_files), progress); {
gnc_progress_dialog_pop(wind->load_progress); gnc_progress_dialog_push(wind->load_progress, 1);
wind->ask_date_format = FALSE; parse_return = scm_call_2(qif_file_parse, SCM_CAR(imported_files),
wind->date_format = NULL; progress);
gnc_progress_dialog_pop(wind->load_progress);
wind->ask_date_format = FALSE;
wind->date_format = NULL;
}
if (parse_return == SCM_BOOL_T) if (parse_return == SCM_BOOL_T)
{ {
/* Canceled by the user. */ /* Canceled by the user. */