diff --git a/client.go b/client.go index 3231f37..91506f4 100644 --- a/client.go +++ b/client.go @@ -101,9 +101,12 @@ func (c *Client) Base32() string { } func (c *Client) base64() []byte { - s, _ := i2pB64enc.DecodeString(c.destination) - alen := binary.BigEndian.Uint16(s[385:387]) - return s[:387+alen] + if c.destination != "" { + s, _ := i2pB64enc.DecodeString(c.destination) + alen := binary.BigEndian.Uint16(s[385:387]) + return s[:387+alen] + } + return []byte("") } // Base64 returns the base64 of the local tunnel diff --git a/client_test.go b/client_test.go index d246b71..7d6cf16 100644 --- a/client_test.go +++ b/client_test.go @@ -14,7 +14,6 @@ func setup(t *testing.T) { if err != nil { t.Fatalf("NewDefaultClient() Error: %q\n", err) } - } func teardown(t *testing.T) { @@ -25,5 +24,6 @@ func teardown(t *testing.T) { func TestClientHello(t *testing.T) { setup(t) + t.Log(client.Base32()) teardown(t) }