Skip to content

fix nil-ptr in BuildIndexWithSnapName#18248

Merged
AskAlexSharov merged 5 commits into
release/3.3from
alex/nil_ptr_seed_33
Dec 11, 2025
Merged

fix nil-ptr in BuildIndexWithSnapName#18248
AskAlexSharov merged 5 commits into
release/3.3from
alex/nil_ptr_seed_33

Conversation

@AskAlexSharov

Copy link
Copy Markdown
Collaborator

@AskAlexSharov AskAlexSharov enabled auto-merge (squash) December 11, 2025 01:09

@anacrolix anacrolix left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think a helper is required here for the nil/interface handling. FileInfo is a struct type so you won't get any value from checking for nil on it.

I would just remove the isNil(info) check, and replace isNil(info.Type) with info.Type == nil.

I can see you're panicking because there's some kind of bad state creeping in here. A few functions up there's a call that returns the FileInfo value with a lot of checks missing. I wonder if you mean to check if FileInfo is instead the zero/empty value which would tel you it hasn't been initialized correctly.

@AskAlexSharov AskAlexSharov merged commit 2ef0a82 into release/3.3 Dec 11, 2025
11 checks passed
@AskAlexSharov AskAlexSharov deleted the alex/nil_ptr_seed_33 branch December 11, 2025 02:03
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.

2 participants