os/vfs.h: fix possible nullptr dereference

Fixes #3694
This commit is contained in:
Norman Feske 2020-03-13 19:34:53 +01:00
parent 27c10e0d5a
commit bad088af11
1 changed files with 5 additions and 1 deletions

View File

@ -613,7 +613,11 @@ class Genode::Watcher
_watch(fs, alloc, rel_path, handler);
}
~Watcher() { _handle->fs().close(_handle); }
~Watcher()
{
if (_handle)
_handle->fs().close(_handle);
}
};