Skip to content
This repository has been archived by the owner on Jun 5, 2020. It is now read-only.

Commit

Permalink
fix panic with uninitialized directories
Browse files Browse the repository at this point in the history
  • Loading branch information
verdverm committed Apr 29, 2020
1 parent f3fdf92 commit 0131f9e
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/modder/modder_load.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package modder

import (
"fmt"

"github.com/go-git/go-billy/v5/osfs"
)

Expand Down Expand Up @@ -116,6 +118,11 @@ func (mdr *Modder) LoadModFile() error {
return err
}

// no file
if m.ModFile == nil {
return fmt.Errorf("no %q file found, directory not initialized for %s", mdr.ModFile, mdr.Name)
}

m.Module = m.ModFile.Module.Mod.Path

return nil
Expand Down

0 comments on commit 0131f9e

Please sign in to comment.