From 2e49e89e7b5c5a0ebaa352e429f3e573a1fa778f Mon Sep 17 00:00:00 2001 From: David Sansome Date: Sun, 8 Jan 2012 12:55:06 +0000 Subject: [PATCH] Fix a crash on startup after disabling watching the library for changes. Fixes issue 2585 --- src/library/librarywatcher.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/library/librarywatcher.cpp b/src/library/librarywatcher.cpp index 41afe69be..a5f5ebf87 100644 --- a/src/library/librarywatcher.cpp +++ b/src/library/librarywatcher.cpp @@ -695,7 +695,9 @@ void LibraryWatcher::ReloadSettings() { } if (!monitor_ && was_monitoring_before) { - fs_watcher_->Clear(); + if (fs_watcher_) { + fs_watcher_->Clear(); + } } else if (monitor_ && !was_monitoring_before) { // Add all directories to all QFileSystemWatchers again foreach (const DirData& data, watched_dirs_.values()) {