diff --git a/src/lib/nfs/Connection.cxx b/src/lib/nfs/Connection.cxx index a2f0cbb45..a99b845b9 100644 --- a/src/lib/nfs/Connection.cxx +++ b/src/lib/nfs/Connection.cxx @@ -223,7 +223,9 @@ NfsConnection::DestroyContext() { assert(context != nullptr); - SocketMonitor::Cancel(); + if (SocketMonitor::IsDefined()) + SocketMonitor::Cancel(); + nfs_destroy_context(context); context = nullptr; }