Skip to content

Conversation

@Konmoron
Copy link

  • Check if mod is nil before appending to mod.Pkgs
  • Prevent potential nil pointer dereference errors

If the first line of modules.txt is a replace directive, for example:

# dm v0.0.0 => ../db/drivers/dm/8.1.4.80/dm

In this case, the variable mod may not be initialized, causing a nil pointer error. Therefore, check if mod is nil before appending to avoid this issue.

- Check if mod is nil before appending to mod.Pkgs
- Prevent potential nil pointer dereference errors

If the first line of modules.txt is a replace directive, for example:

```txt
# dm v0.0.0 => ../db/drivers/dm/8.1.4.80/dm
```

In this case, the variable mod may not be initialized, causing a nil pointer error. Therefore, check if mod is nil before appending to avoid this issue.
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.

1 participant