From e8f39ce96a3d85de56f6a1425a233b07a5fb54bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20A=C3=9Fmus?= Date: Mon, 4 Aug 2008 14:25:26 +0000 Subject: [PATCH] Don't choke in BPathMonitor::StopWatch(...) if the client never called StartWatching() before and the BPathMonitor stuff is therefor not initialized. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26792 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kits/storage/PathMonitor.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/kits/storage/PathMonitor.cpp b/src/kits/storage/PathMonitor.cpp index d7a7b38db7..c882ebe02f 100644 --- a/src/kits/storage/PathMonitor.cpp +++ b/src/kits/storage/PathMonitor.cpp @@ -815,6 +815,9 @@ BPathMonitor::StartWatching(const char* path, uint32 flags, BMessenger target) /*static*/ status_t BPathMonitor::StopWatching(const char* path, BMessenger target) { + if (sLocker == NULL) + return B_NO_INIT; + BAutolock _(sLocker); WatcherMap::iterator iterator = sWatchers.find(target); @@ -845,6 +848,9 @@ BPathMonitor::StopWatching(const char* path, BMessenger target) /*static*/ status_t BPathMonitor::StopWatching(BMessenger target) { + if (sLocker == NULL) + return B_NO_INIT; + BAutolock _(sLocker); WatcherMap::iterator iterator = sWatchers.find(target);