Index: src/JsEngine.cpp |
diff --git a/src/JsEngine.cpp b/src/JsEngine.cpp |
index f874cf97c7486193aa51c1ee55a6b8c45ebf1adf..30069a576655905029e0dbd6fddc2515b0dd0c70 100644 |
--- a/src/JsEngine.cpp |
+++ b/src/JsEngine.cpp |
@@ -117,6 +117,11 @@ AdblockPlus::JsValuePtr AdblockPlus::JsEngine::Evaluate(const std::string& sourc |
void AdblockPlus::JsEngine::SetEventCallback(const std::string& eventName, |
AdblockPlus::JsEngine::EventCallback callback) |
{ |
+ if (!callback) |
+ { |
+ RemoveEventCallback(eventName); |
+ return; |
+ } |
std::lock_guard<std::mutex> lock(eventCallbacksMutex); |
eventCallbacks[eventName] = callback; |
} |