Skip to content

Commit 6446aea

Browse files
author
Mihail Tsonev
authored
Merge pull request #21 from mptsonev/master
Fix uninstall issue and a NPE
2 parents 4bf9c9f + 8af687f commit 6446aea

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

clients/mtaclient/mta_rest_client.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import (
44
"context"
55
"net/http"
66
"os"
7-
87
"github.com/go-errors/errors"
98

109
baseclient "github.com/SAP/cf-mta-plugin/clients/baseclient"
@@ -187,7 +186,10 @@ func (c MtaRestClient) UploadMtaFile(file os.File) (*models.FileMetadata, error)
187186
return c.client.Operations.UploadMtaFile(params, token)
188187
})
189188

190-
return result.(*operations.UploadMtaFileCreated).Payload, baseclient.NewClientError(err)
189+
if err != nil {
190+
return nil, baseclient.NewClientError(err)
191+
}
192+
return result.(*operations.UploadMtaFileCreated).Payload, nil
191193
}
192194

193195
func (c MtaRestClient) GetMtaOperationLogContent(operationID, logID string) (string, error) {

mta_plugin.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ var Commands = []commands.Command{
3434
// Run runs this plugin
3535
func (p *MtaPlugin) Run(cliConnection plugin.CliConnection, args []string) {
3636
disableStdOut()
37+
if args[0] == "CLI-MESSAGE-UNINSTALL" {
38+
return
39+
}
3740
command, err := findCommand(args[0])
3841
if err != nil {
3942
log.Fatalln(err)

0 commit comments

Comments
 (0)