Avoid null pointer dereference

Spotted by coverity.
This commit is contained in:
Jean-Marc Lasgouttes 2022-02-20 17:09:49 +01:00
parent e263fe8e03
commit a900667ea1

View File

@ -400,7 +400,7 @@ void Loader::Impl::resetFile(FileName const & file)
// new file.
bool continue_monitoring = false;
if (!old_file.empty()) {
if (cached_item_ && !old_file.empty()) {
continue_monitoring = cached_item_->monitoring();
// cached_item_ is going to be reset, so the connected
// signal needs to be disconnected.