From d3b337ff30edaa5052b2bbb8199b74679fce39bc Mon Sep 17 00:00:00 2001 From: Ulrich Schreiner Date: Fri, 6 Feb 2015 12:05:39 +0100 Subject: [PATCH] bug in error handling --- plugin/remote/github/helper.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/plugin/remote/github/helper.go b/plugin/remote/github/helper.go index 5d8051b73..2f05ea0cc 100644 --- a/plugin/remote/github/helper.go +++ b/plugin/remote/github/helper.go @@ -243,12 +243,12 @@ func GetKeyTitle(rawurl string) (string, error) { // DeleteKey is a helper function that deletes a deploy key // for the specified repository. func DeleteKey(client *github.Client, owner, name, title, key string) error { - var k, _ = GetKey(client, owner, name, title) - if k != nil { - _, err := client.Repositories.DeleteKey(owner, name, *k.ID) + var k, err = GetKey(client, owner, name, title) + if err != nil { return err } - return nil + _, err = client.Repositories.DeleteKey(owner, name, *k.ID) + return err } // CreateKey is a helper function that creates a deploy key