Skip to content

Commit

Permalink
dont use logForObject with nil pointer
Browse files Browse the repository at this point in the history
the d.account field is known to be nil here, so logforobject
will crash on that.  use a plain info log
  • Loading branch information
zzzeek committed Feb 7, 2024
1 parent 3dcb5d5 commit 39a0a29
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions api/v1beta1/mariadbdatabase_funcs.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 39a0a29

Please sign in to comment.