From b775b19366dca169246b906e27bf6244f786c86e Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Sun, 11 Sep 2011 00:12:18 +0900 Subject: [PATCH] Check socket is null or not before calling (add|delete)SocketForReadCheck. --- src/DHTInteractionCommand.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/DHTInteractionCommand.cc b/src/DHTInteractionCommand.cc index 101d6a22..ff17a8a6 100644 --- a/src/DHTInteractionCommand.cc +++ b/src/DHTInteractionCommand.cc @@ -63,12 +63,16 @@ DHTInteractionCommand::~DHTInteractionCommand() void DHTInteractionCommand::setReadCheckSocket(const SocketHandle& socket) { readCheckSocket_ = socket; - e_->addSocketForReadCheck(socket, this); + if(socket) { + e_->addSocketForReadCheck(socket, this); + } } void DHTInteractionCommand::disableReadCheckSocket(const SocketHandle& socket) { - e_->deleteSocketForReadCheck(socket, this); + if(socket) { + e_->deleteSocketForReadCheck(socket, this); + } } bool DHTInteractionCommand::execute()