Monorepo for Tangled

appview/pulls: check if record.Source is nil

It will be for patch pulls. Prevents a nil pointer deref when we set newSourceRev.

authored by

Anirudh Oppiliappan and committed by tangled.org 2c65fbc9 e11751cd

+4 -1
+4 -1
appview/pulls/pulls.go
··· 1915 1915 record := pull.AsRecord() 1916 1916 record.PatchBlob = blob.Blob 1917 1917 record.CreatedAt = time.Now().Format(time.RFC3339) 1918 - record.Source.Sha = newSourceRev 1918 + 1919 + if record.Source != nil { 1920 + record.Source.Sha = newSourceRev 1921 + } 1919 1922 1920 1923 _, err = comatproto.RepoPutRecord(r.Context(), client, &comatproto.RepoPutRecord_Input{ 1921 1924 Collection: tangled.RepoPullNSID,