From b5987a9299e72743f085156963466a30fe033d1c Mon Sep 17 00:00:00 2001 From: Sacha Froment Date: Fri, 9 Nov 2018 17:55:51 +0100 Subject: [PATCH] fix(ble): fix crash on unknow multiaddr Signed-off-by: Sacha Froment --- core/network/ble/darwin.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/core/network/ble/darwin.go b/core/network/ble/darwin.go index fe576b5d45..a16983df20 100644 --- a/core/network/ble/darwin.go +++ b/core/network/ble/darwin.go @@ -74,6 +74,8 @@ func (b *Conn) Write(p []byte) (n int, err error) { val, err := b.rAddr.ValueForProtocol(PBle) if err != nil { return 0, err + } else if val == "" { + return 0, fmt.Errorf("ble can't dial unknow multiaddr") } ma := C.CString(val)