Skip to content

Commit

Permalink
Fix crash in gnc_owner_get_owner
Browse files Browse the repository at this point in the history
If there are no owners gnc_general_search_get_selected
returns nullptr without showing the dialog.
  • Loading branch information
jralls committed Mar 24, 2023
1 parent 03bca60 commit fc41a51
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions gnucash/gnome/business-gnome-utils.c
Expand Up @@ -285,6 +285,9 @@ void gnc_owner_get_owner (GtkWidget *widget, GncOwner *owner)
QofInstance *instance =
gnc_general_search_get_selected (GNC_GENERAL_SEARCH (widget));

if (!instance)
return;

if (owner->type == GNC_OWNER_NONE ||
g_strcmp0(instance->e_type, qofOwnerGetType(owner)) == 0)
qofOwnerSetEntity(owner, instance);
Expand Down

0 comments on commit fc41a51

Please sign in to comment.