From 409e7417e7624837ce3cfdb3771a0925c283e84d Mon Sep 17 00:00:00 2001 From: Vilsol Date: Fri, 11 Oct 2024 03:40:13 +0300 Subject: [PATCH] fix: handle deleted mod dependencies --- api/api.go | 2 -- gql/resolver_versions.go | 4 +++- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/api/api.go b/api/api.go index f53e140..454f68a 100644 --- a/api/api.go +++ b/api/api.go @@ -295,10 +295,8 @@ func Setup(ctx context.Context) *echo.Echo { slog.String("time_rfc3339", time.Now().Format(time.RFC3339)), slog.String("remote_ip", c.RealIP()), slog.String("host", req.Host), - slog.String("uri", req.RequestURI), slog.String("method", req.Method), slog.String("path", p), - slog.String("referer", req.Referer()), slog.String("user_agent", req.UserAgent()), slog.Int("status", res.Status), slog.Int64("latency", stop.Sub(start).Nanoseconds()/1000), diff --git a/gql/resolver_versions.go b/gql/resolver_versions.go index 6ad6fdc..b29e9cc 100644 --- a/gql/resolver_versions.go +++ b/gql/resolver_versions.go @@ -415,7 +415,9 @@ func (r *versionResolver) Dependencies(ctx context.Context, obj *generated.Versi } for _, dependency := range dependencies { - dependency.ModID = dependency.Edges.Mod.ModReference + if dependency.Edges.Mod != nil { + dependency.ModID = dependency.Edges.Mod.ModReference + } } versionDependencyCache.SetWithTTL(obj.ID, dependencies, int64(len(dependencies)), versionDependencyCacheTTL)