Explorar o código

Merge pull request #374 from Zariel/nil-interface-routing-key

ensure that the value asertion does not panic
Chris Bannister %!s(int64=11) %!d(string=hai) anos
pai
achega
5e2ead9557
Modificáronse 1 ficheiros con 3 adicións e 1 borrados
  1. 3 1
      session.go

+ 3 - 1
session.go

@@ -223,7 +223,9 @@ func (s *Session) routingKeyInfo(stmt string) (*routingKeyInfo, error) {
 			return nil, inflight.err
 		}
 
-		return inflight.value.(*routingKeyInfo), nil
+		key, _ := inflight.value.(*routingKeyInfo)
+
+		return key, nil
 	}
 
 	// create a new inflight entry while the data is created