small fixes
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Timofey.Kovalev 2021-06-23 00:49:08 +03:00
parent a57abdd94d
commit 95093616a0

View File

@ -134,6 +134,10 @@ func (db *dbLayer) getPlayerByID(ctx context.Context, id string) (*Player, error
row := db.db.QueryRowContext(ctx, query, id)
if err := row.Err(); err != nil {
if err == sql.ErrNoRows {
return nil, nil
}
return nil, errors.Wrapf(err, "Failed to run db query [%s]", query)
}
@ -152,6 +156,10 @@ func (db *dbLayer) getPlayerByName(ctx context.Context, name string) (*Player, e
row := db.db.QueryRowContext(ctx, query, name)
if err := row.Err(); err != nil {
if err == sql.ErrNoRows {
return nil, nil
}
return nil, errors.Wrapf(err, "Failed to run db query [%s]", query)
}
@ -170,6 +178,10 @@ func (db *dbLayer) getKillsByPlayerID(ctx context.Context, playerID string) (int
row := db.db.QueryRowContext(ctx, query, playerID)
if err := row.Err(); err != nil {
if err == sql.ErrNoRows {
return 0, nil
}
return 0, errors.Wrapf(err, "Failed to run db query [%s]", query)
}