Index: mojo/public/cpp/bindings/lib/interface_endpoint_client.cc |
diff --git a/mojo/public/cpp/bindings/lib/interface_endpoint_client.cc b/mojo/public/cpp/bindings/lib/interface_endpoint_client.cc |
index e1f388aa21a4dd70d5ce615596261242948e2344..9ececaa79863bd798f634f257437d77a9082539e 100644 |
--- a/mojo/public/cpp/bindings/lib/interface_endpoint_client.cc |
+++ b/mojo/public/cpp/bindings/lib/interface_endpoint_client.cc |
@@ -159,7 +159,8 @@ InterfaceEndpointClient::InterfaceEndpointClient( |
InterfaceEndpointClient::~InterfaceEndpointClient() { |
DCHECK(thread_checker_.CalledOnValidThread()); |
- handle_.group_controller()->DetachEndpointClient(handle_); |
+ if (handle_.is_valid()) |
+ handle_.group_controller()->DetachEndpointClient(handle_); |
} |
AssociatedGroup* InterfaceEndpointClient::associated_group() { |