From bb486a72231e820d81b386c3d99670a778c4dd06 Mon Sep 17 00:00:00 2001 From: Ingo Weinhold Date: Sat, 10 Jul 2010 15:09:46 +0000 Subject: [PATCH] cache_end_transaction(): Allow the hook parameter to be NULL. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37461 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/system/kernel/cache/block_cache.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/system/kernel/cache/block_cache.cpp b/src/system/kernel/cache/block_cache.cpp index 08d706b979..4241b53925 100644 --- a/src/system/kernel/cache/block_cache.cpp +++ b/src/system/kernel/cache/block_cache.cpp @@ -2768,8 +2768,9 @@ cache_end_transaction(void* _cache, int32 id, notify_transaction_listeners(cache, transaction, TRANSACTION_ENDED); - if (add_transaction_listener(cache, transaction, TRANSACTION_WRITTEN, hook, - data) != B_OK) { + if (hook != NULL + && add_transaction_listener(cache, transaction, TRANSACTION_WRITTEN, + hook, data) != B_OK) { return B_NO_MEMORY; }