From 39a0a2930070bee3250e23e78f45e1128cdb97c9 Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Wed, 7 Feb 2024 13:08:34 -0500 Subject: [PATCH] dont use logForObject with nil pointer the d.account field is known to be nil here, so logforobject will crash on that. use a plain info log --- api/v1beta1/mariadbdatabase_funcs.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/api/v1beta1/mariadbdatabase_funcs.go b/api/v1beta1/mariadbdatabase_funcs.go index 8aa94a1f..e8252405 100644 --- a/api/v1beta1/mariadbdatabase_funcs.go +++ b/api/v1beta1/mariadbdatabase_funcs.go @@ -398,10 +398,8 @@ func (d *Database) getDBWithName( if k8s_errors.IsNotFound(err) { // if account can't be found, log it, but don't quit, still // return the Database with MariaDBDatabase - util.LogForObject( - h, + h.GetLogger().Info( fmt.Sprintf("Could not find account %s for Database named %s", username, namespace), - d.account, ) // note that d.account remains nil in this case