Monorepo for Tangled tangled.org

appview/pulls: check if record.Source is nil #1075

merged opened by anirudh.fi targeting master

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

Labels

None yet.

assignee

None yet.

Participants 1
AT URI
at://did:plc:hwevmowznbiukdf6uk5dwrrq/sh.tangled.repo.pull/3meqtypyvvn22
+4 -1
Diff #0
+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,

History

1 round 0 comments
sign up or login to add to the discussion
anirudh.fi submitted #0
1 commit
expand
3dc2f33a
appview/pulls: check if record.Source is nil
expand 0 comments
pull request successfully merged