Skip to content

Commit

Permalink
fix nil point
Browse files Browse the repository at this point in the history
  • Loading branch information
HarrisChu committed Feb 24, 2022
1 parent ff5474f commit 5d9a6ff
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/common/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ type (
IGraphClient interface {
IClient
GetData() (Data, error)
Execute(stat string) (IGraphResponse, error)
Execute(stmt string) (IGraphResponse, error)
}

// IGraphResponse graph response, just support 3 functions to user.
Expand Down
3 changes: 3 additions & 0 deletions pkg/nebulagraph/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ func (gp *GraphPool) GetSession(username, password string) (common.IGraphClient,
// balancer, ccore just use the first endpoint
index := len(gp.clients) % len(gp.hosts)
client, err := gp.clientGetter(gp.hosts[index], username, password)

if gp.Version == "" {
gp.Version = string(client.Version())
}
Expand Down Expand Up @@ -267,6 +268,8 @@ func (gc *GraphClient) Execute(stmt string) (common.IGraphResponse, error) {
rows = 0
latency = 0
} else {
// no err, so the error code is ErrorCode_SUCCEEDED
codeErr, _ = nerrors.AsCodeError(nerrors.NewCodeError(nerrors.ErrorCode_SUCCEEDED, ""))
rs, _ = wrapper.GenResultSet(resp, gc.Client.Factory(), types.TimezoneInfo{})
rows = int32(rs.GetRowSize())
latency = resp.GetLatencyInUs()
Expand Down

0 comments on commit 5d9a6ff

Please sign in to comment.