Skip to content

Commit

Permalink
Fixing panic caused by assignment happening before err check (#263)
Browse files Browse the repository at this point in the history
  • Loading branch information
evyatarmeged authored Jan 5, 2025
1 parent e832117 commit 89ba1b1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/mapper/pkg/resolvers/schema.helpers.resolvers.go
Original file line number Diff line number Diff line change
Expand Up @@ -446,13 +446,13 @@ func (r *Resolver) resolveOtterizeIdentityForExternalAccessDestination(ctx conte
}

dstSvcIdentity, ok, err := r.kubeFinder.ResolveOtterizeIdentityForService(ctx, destService, dest.LastSeen)
dstSvcIdentity.ResolutionData.Host = lo.ToPtr(destIP)
if err != nil {
return model.OtterizeServiceIdentity{}, false, errors.Wrap(err)
}
if !ok {
return model.OtterizeServiceIdentity{}, false, nil
}
dstSvcIdentity.ResolutionData.Host = lo.ToPtr(destIP)

return dstSvcIdentity, true, nil
}
Expand Down

0 comments on commit 89ba1b1

Please sign in to comment.