mirror of https://github.com/grpc/grpc-node.git
grpc-js-xds: Add null checks to handle generated code changes
This commit is contained in:
parent
365b379193
commit
f216ecef00
|
@ -228,7 +228,7 @@ class XdsResolver implements Resolver {
|
|||
onValidUpdate: (update: Listener__Output) => {
|
||||
const httpConnectionManager = decodeSingleResource(HTTP_CONNECTION_MANGER_TYPE_URL_V3, update.api_listener!.api_listener!.value);
|
||||
const defaultTimeout = httpConnectionManager.common_http_protocol_options?.idle_timeout;
|
||||
if (defaultTimeout === undefined) {
|
||||
if (defaultTimeout === null || defaultTimeout === undefined) {
|
||||
this.latestDefaultTimeout = undefined;
|
||||
} else {
|
||||
this.latestDefaultTimeout = protoDurationToDuration(defaultTimeout);
|
||||
|
|
|
@ -137,7 +137,7 @@ export class RdsState implements XdsStreamState<RouteConfiguration__Output> {
|
|||
if (route.action !== 'route') {
|
||||
return false;
|
||||
}
|
||||
if ((route.route === undefined) || SUPPORTED_CLUSTER_SPECIFIERS.indexOf(route.route.cluster_specifier) < 0) {
|
||||
if ((route.route === undefined) || (route.route === null) || SUPPORTED_CLUSTER_SPECIFIERS.indexOf(route.route.cluster_specifier) < 0) {
|
||||
return false;
|
||||
}
|
||||
if (EXPERIMENTAL_FAULT_INJECTION) {
|
||||
|
|
Loading…
Reference in New Issue