Skip to content

Commit

Permalink
Fix crash with keybase --standalone log send (#10628)
Browse files Browse the repository at this point in the history
This makes it work again, albeit without UI logs.
  • Loading branch information
akalin-keybase committed Feb 21, 2018
1 parent e4abeaf commit cb05b63
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 5 deletions.
3 changes: 2 additions & 1 deletion go/chat/tlf.go
@@ -1,6 +1,7 @@
package chat

import (
"errors"
"fmt"
"time"

Expand Down Expand Up @@ -34,7 +35,7 @@ func NewKBFSNameInfoSource(g *globals.Context) *KBFSNameInfoSource {

func (t *KBFSNameInfoSource) tlfKeysClient() (*keybase1.TlfKeysClient, error) {
if t.G().ConnectionManager == nil {
return nil, fmt.Errorf("no connection manager available")
return nil, errors.New("no connection manager available")
}
xp := t.G().ConnectionManager.LookupByClientType(keybase1.ClientType_KBFS)
if xp == nil {
Expand Down
5 changes: 4 additions & 1 deletion go/client/cmd_log_send.go
Expand Up @@ -124,9 +124,12 @@ func (c *CmdLogSend) pokeUI() error {
return err
}
err = cli.PrepareLogsend(context.Background())
if err != nil {
return err
}
// Give the GUI a moment to get its logs in order
time.Sleep(1 * time.Second)
return err
return nil
}

func (c *CmdLogSend) confirm() error {
Expand Down
3 changes: 2 additions & 1 deletion go/service/git.go
Expand Up @@ -4,6 +4,7 @@
package service

import (
"errors"
"fmt"
"time"

Expand Down Expand Up @@ -340,7 +341,7 @@ func (h *GitHandler) kbfsClient() (*keybase1.KBFSGitClient, error) {
return nil, libkb.LoginRequiredError{}
}
if h.G().ConnectionManager == nil {
return nil, fmt.Errorf("no connection manager available")
return nil, errors.New("no connection manager available")
}
xp := h.G().ConnectionManager.LookupByClientType(keybase1.ClientType_KBFS)
if xp == nil {
Expand Down
9 changes: 7 additions & 2 deletions go/service/logsend.go
Expand Up @@ -5,11 +5,12 @@ package service

import (
"errors"
"time"

"github.com/keybase/client/go/libkb"
keybase1 "github.com/keybase/client/go/protocol/keybase1"
"github.com/keybase/go-framed-msgpack-rpc/rpc"
"golang.org/x/net/context"
"time"
)

type LogsendHandler struct {
Expand All @@ -25,7 +26,11 @@ func NewLogsendHandler(xp rpc.Transporter, g *libkb.GlobalContext) *LogsendHandl
}

func (h *LogsendHandler) PrepareLogsend(ctx context.Context) error {
xp := h.G().ConnectionManager.LookupByClientType(keybase1.ClientType_GUI_MAIN)
connMgr := h.G().ConnectionManager
if connMgr == nil {
return errors.New("no connection manager available")
}
xp := connMgr.LookupByClientType(keybase1.ClientType_GUI_MAIN)
if xp == nil {
return errors.New("GUI main process wasn't found")
}
Expand Down

0 comments on commit cb05b63

Please sign in to comment.