Skip to content
This repository was archived by the owner on Sep 9, 2020. It is now read-only.

Add temporary solution to avoid a panic #630

Merged
merged 1 commit into from
May 23, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion internal/gps/pkgtree/pkgtree.go
Original file line number Diff line number Diff line change
Expand Up @@ -626,7 +626,15 @@ func wmToReach(workmap map[string]wm, backprop bool) (ReachMap, map[string]*Prob
// that was already completed (black), we don't have to defend against
// an empty path here.

fromErr := errmap[from]
fromErr, exists := errmap[from]
// FIXME: It should not be possible for fromErr to not exist,
// See issue https://github.com/golang/dep/issues/351
// This is a temporary solution to avoid a panic.
if !exists {
fromErr = &ProblemImportError{
Err: fmt.Errorf("unknown error for %q, if you get this error see https://github.com/golang/dep/issues/351", from),
}
}
err := &ProblemImportError{
Err: fromErr.Err,
Cause: make([]string, 0, len(path)+len(fromErr.Cause)+1),
Expand Down