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
This commit is contained in:
Stephan Aßmus 2008-08-04 14:25:26 +00:00
parent fe74d94e3c
commit e8f39ce96a

View File

@ -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);