~sircmpwn/godocs.io

gddo: gddo-server: Fix panic on nil pointer dereference v2 APPLIED

Adnan Maolood: 1
 gddo-server: Fix panic on nil pointer dereference

 1 files changed, 8 insertions(+), 6 deletions(-)
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.sr.ht/~sircmpwn/godocs.io/patches/22433/mbox | git am -3
Learn more about email & git
View this thread in the archives

[PATCH gddo v2] gddo-server: Fix panic on nil pointer dereference Export this patch

---
The other patch messed up the error handling.

 gddo-server/crawl.go | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/gddo-server/crawl.go b/gddo-server/crawl.go
index 573e0d4..bf66d4b 100644
--- a/gddo-server/crawl.go
+++ b/gddo-server/crawl.go
@@ -48,17 +48,19 @@ func (s *Server) crawl(ctx context.Context, modulePath string) (database.Module,

	// Get latest version
	var latest string
	var err error
	if modulePath == stdlib.ModulePath {
		var err error
		latest, err = stdlib.ZipInfo(proxy.LatestVersion)
		if err != nil {
			return database.Module{}, err
		}
	} else {
		var info *proxy.VersionInfo
		info, err = s.proxyClient.GetInfo(ctx, modulePath, proxy.LatestVersion)
		info, err := s.proxyClient.GetInfo(ctx, modulePath, proxy.LatestVersion)
		if err != nil {
			return database.Module{}, err
		}
		latest = info.Version
	}
	if err != nil {
		return database.Module{}, err
	}

	seriesPath, _, _ := module.SplitPathVersion(modulePath)

-- 
2.31.1
Thanks!

To git@git.sr.ht:~sircmpwn/gddo
   24ba5a5..2923634  master -> master