summaryrefslogtreecommitdiffhomepage
path: root/server/grpc_server.go
diff options
context:
space:
mode:
authorISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>2015-06-11 18:53:54 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2015-06-16 06:22:11 +0900
commit5f2b37d487fa815a8ca994edd6d47e0af91b93b2 (patch)
tree758ddc87cf9e56d7281943bf17a5eb7292f54608 /server/grpc_server.go
parent6250195ce4b504aee150eb6004f1de9d98b6ccc4 (diff)
server: add error handling for grpc
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Diffstat (limited to 'server/grpc_server.go')
-rw-r--r--server/grpc_server.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/server/grpc_server.go b/server/grpc_server.go
index 79a3dc4d..19a2ba28 100644
--- a/server/grpc_server.go
+++ b/server/grpc_server.go
@@ -68,6 +68,9 @@ const (
const GRPC_PORT = 8080
func convertAf2Rf(af *api.AddressFamily) (bgp.RouteFamily, error) {
+ if af == nil {
+ return bgp.RouteFamily(0), fmt.Errorf("address family is nil")
+ }
if af.Equal(api.AF_IPV4_UC) {
return bgp.RF_IPv4_UC, nil
} else if af.Equal(api.AF_IPV6_UC) {