Skip to content

Commit b9c6045

Browse files
kirbyquerbyhfwang
authored andcommitted
Check for error before accessing field on sql
1 parent ebfd3f9 commit b9c6045

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

cmd/cloud_sql_proxy/proxy.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -238,11 +238,10 @@ func parseInstanceConfig(dir, instance string, cl *http.Client) (instanceConfig,
238238
}
239239
} else {
240240
sql, err := sqladmin.New(cl)
241-
sql.BasePath = *host
242241
if err != nil {
243242
return instanceConfig{}, err
244243
}
245-
244+
sql.BasePath = *host
246245
ret.Instance = instance
247246
// Default to unix socket.
248247
ret.Network = "unix"

0 commit comments

Comments
 (0)