Skip to content

Commit

Permalink
check for empty public key
Browse files Browse the repository at this point in the history
  • Loading branch information
Kifen committed Mar 6, 2020
1 parent 90794a5 commit 358949b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 7 additions & 1 deletion pkg/app/appnet/skywire_networker.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package appnet
import (
"context"
"errors"
"fmt"
"io"
"net"
"strings"
Expand Down Expand Up @@ -50,7 +51,12 @@ func (r *SkywireNetworker) DialContext(ctx context.Context, addr Addr) (net.Conn
return nil, err
}

rg, err := r.r.DialRoutes(ctx, addr.PubKey, routing.Port(localPort), addr.Port, router.DefaultDialOptions())
rPK := addr.PubKey
if rPK.Null() {
return nil, fmt.Errorf("Empty public key: %s", rPK)
}

rg, err := r.r.DialRoutes(ctx, rPK, routing.Port(localPort), addr.Port, router.DefaultDialOptions())
if err != nil {
return nil, err
}
Expand Down
2 changes: 1 addition & 1 deletion vendor/modules.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# github.com/SkycoinProject/dmsg v0.0.0-20200306131535-fabb2c8177e9
# github.com/SkycoinProject/dmsg v0.0.0-20200306131535-fabb2c8177e9 => ../dmsg
github.com/SkycoinProject/dmsg
github.com/SkycoinProject/dmsg/cipher
github.com/SkycoinProject/dmsg/disc
Expand Down

0 comments on commit 358949b

Please sign in to comment.