Skip to content

Commit

Permalink
bugfix: avoid nil point
Browse files Browse the repository at this point in the history
  • Loading branch information
CMGS committed Nov 25, 2020
1 parent c306654 commit beda46b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,10 @@ unit-test:
./rpc/. ./lock/etcdlock/... \
./auth/simple/... \
./cluster/calcium/... \
./resources/... \
./discovery/helium...
./discovery/helium... \
./resources/storage/... \
./resources/volume/... \
./resources/cpumem/...

lint:
golangci-lint run
3 changes: 3 additions & 0 deletions rpc/transform.go
Original file line number Diff line number Diff line change
Expand Up @@ -531,6 +531,9 @@ func toCoreExecuteWorkloadOptions(b *pb.ExecuteWorkloadOptions) (opts *types.Exe
}

func toRPCCapacityMessage(msg *types.CapacityMessage) *pb.CapacityMessage {
if msg == nil {
return nil
}
caps := map[string]int64{}
for nodename, capacity := range msg.NodeCapacities {
caps[nodename] = int64(capacity)
Expand Down

0 comments on commit beda46b

Please sign in to comment.