diff --git a/interfaces/kits/js/src/mod_fs/properties/ani/watcher_ani.cpp b/interfaces/kits/js/src/mod_fs/properties/ani/watcher_ani.cpp index 241764e0406653438c2f0326962ab7b057d4626b..9a06a6f3e5b0de6cb5263b5e6b816e55718eb662 100644 --- a/interfaces/kits/js/src/mod_fs/properties/ani/watcher_ani.cpp +++ b/interfaces/kits/js/src/mod_fs/properties/ani/watcher_ani.cpp @@ -63,6 +63,7 @@ ani_object WatcherAni::CreateWatcherSync( ErrorHandler::Throw(env, err); return nullptr; } + const FsWatcher *watcher = ret.GetData().value(); auto result = FsWatcherWrapper::Wrap(env, move(watcher)); if (result == nullptr) {