Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix nil pointer exception on creating account, when relay is self-hosted #705

Merged
merged 2 commits into from
Jul 20, 2024

Conversation

itaru2622
Copy link
Contributor

close #704

@itaru2622
Copy link
Contributor Author

this PR fix the em-bug by #696

@itaru2622
Copy link
Contributor Author

@ericvolp12 @bnewbold could you review this PR please.

@bnewbold
Copy link
Collaborator

Looks like a good catch!

Instead of duplicating the nil check and assignment in both conditional branches of the if statement, could you move it just above? Like:

diff --git a/cmd/bigsky/main.go b/cmd/bigsky/main.go
index 33e60a0b..d0961ecc 100644
--- a/cmd/bigsky/main.go
+++ b/cmd/bigsky/main.go
@@ -348,10 +348,10 @@ func runBigsky(cctx *cli.Context) error {
 
        rlskip := cctx.String("bsky-social-rate-limit-skip")
        ix.ApplyPDSClientSettings = func(c *xrpc.Client) {
+               if c.Client == nil {
+                       c.Client = util.RobustHTTPClient()
+               }
                if strings.HasSuffix(c.Host, ".bsky.network") {
-                       if c.Client == nil {
-                               c.Client = util.RobustHTTPClient()
-                       }
                        c.Client.Timeout = time.Minute * 30
                        if rlskip != "" {
                                c.Headers = map[string]string{

itaru2622 added a commit to itaru2622/bluesky-indigo that referenced this pull request Jul 17, 2024
@itaru2622
Copy link
Contributor Author

@bnewbold thank you for your review. I followed your comment and pushed update.

@bnewbold bnewbold merged commit a24c682 into bluesky-social:main Jul 20, 2024
2 checks passed
@itaru2622 itaru2622 deleted the isssue704 branch July 24, 2024 03:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bug: self-hosting relay raises nil pointer exception on creating account in PDS.
2 participants