From 08d4db20bf02bc4a2a9909be2f725b84aec4afe6 Mon Sep 17 00:00:00 2001 From: Kegan Dougal Date: Mon, 24 Oct 2016 10:22:54 +0100 Subject: [PATCH] Fix panic if github is down --- src/github.com/matrix-org/go-neb/services/github/github.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/github.com/matrix-org/go-neb/services/github/github.go b/src/github.com/matrix-org/go-neb/services/github/github.go index 0483e41..a829666 100644 --- a/src/github.com/matrix-org/go-neb/services/github/github.go +++ b/src/github.com/matrix-org/go-neb/services/github/github.go @@ -98,6 +98,9 @@ func (s *githubService) cmdGithubCreate(roomID, userID string, args []string) (i }) if err != nil { log.WithField("err", err).Print("Failed to create issue") + if res == nil { + return nil, fmt.Errorf("Failed to create issue. Failed to connect to Github") + } return nil, fmt.Errorf("Failed to create issue. HTTP %d", res.StatusCode) }