You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I found that (*Worktree).Commit method is taking pointer as parameter, and derenferencing it without checking if it is nil.
If someone passes nil there, It should panic for sure.
I think if we need users to pass non-nil pointer, we should document it.
Or we could just replace it with pointer to empty struct if it is nil.
I thought about changing the parameter to non-pointer struct, but it seems like it is breaking change and we will lose consistency in codebase.
I found that
(*Worktree).Commit
method is taking pointer as parameter, and derenferencing it without checking if it is nil.If someone passes nil there, It should panic for sure.
I think if we need users to pass non-nil pointer, we should document it.
Or we could just replace it with pointer to empty struct if it is nil.
I thought about changing the parameter to non-pointer struct, but it seems like it is breaking change and we will lose consistency in codebase.
Example code:
The text was updated successfully, but these errors were encountered: