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

Commit 263c6df

Browse files
committed
add temporary solution to avoid a panic
1 parent f850240 commit 263c6df

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

internal/gps/pkgtree/pkgtree.go

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -626,7 +626,15 @@ func wmToReach(workmap map[string]wm, backprop bool) (ReachMap, map[string]*Prob
626626
// that was already completed (black), we don't have to defend against
627627
// an empty path here.
628628

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

0 commit comments

Comments
 (0)