[gnc-plugin-page-register] if account==NULL, skip AccountIsPriced

because gnc_plugin_page_register_ui_initial_state may be called for
non-account registers (eg the sx editor) and account may be null,
don't call xaccAccountIsPriced on null account.
This commit is contained in:
Christopher Lam 2022-04-19 22:42:54 +08:00
parent 394e0a4b71
commit 37791b608c

View File

@ -1293,7 +1293,7 @@ gnc_plugin_page_register_ui_initial_state (GncPluginPageRegister* page)
"visible", gnc_prefs_is_extra_enabled ());
gnc_plugin_update_actions (action_group, actions_requiring_priced_account,
"sensitive", xaccAccountIsPriced (account));
"sensitive", account && xaccAccountIsPriced (account));
/* Set "style" radio button */
ledger_type = gnc_ledger_display_type (priv->ledger);