mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Ensure that a dereferenced variable isn't NULL.
Found by clang static analyzer.
This commit is contained in:
parent
43a30e1c97
commit
4ffeb3efac
@ -1752,7 +1752,7 @@ xaccTransRollbackEdit (Transaction *trans)
|
||||
if (!qof_instance_is_dirty(QOF_INSTANCE(s)))
|
||||
continue;
|
||||
|
||||
if (i < num_preexist)
|
||||
if (i < num_preexist && onode)
|
||||
{
|
||||
Split *so = onode->data;
|
||||
|
||||
|
@ -486,7 +486,7 @@ compile_sort (QofQuerySort *sort, QofIdType obj)
|
||||
/* If we have valid parameters, grab the compare function,
|
||||
* If not, check if this is the default sort.
|
||||
*/
|
||||
if (sort->param_fcns)
|
||||
if (sort->param_fcns && resObj)
|
||||
{
|
||||
/* First, check if this parameter has a sort function override.
|
||||
* if not then check if there's a global compare function for the type
|
||||
@ -535,7 +535,7 @@ static void compile_terms (QofQuery *q)
|
||||
* If not, see if this is the default sort.
|
||||
*/
|
||||
|
||||
if (qt->param_fcns)
|
||||
if (qt->param_fcns && resObj)
|
||||
qt->pred_fcn = qof_query_core_get_predicate (resObj->param_type);
|
||||
else
|
||||
qt->pred_fcn = NULL;
|
||||
|
Loading…
Reference in New Issue
Block a user