Skip to content

Commit d8cd30d

Browse files
authored
fix(watch): check if __ob__ has value before addSub (#477)
1 parent 01ca6ff commit d8cd30d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/apis/watch.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ function createWatcher(
321321

322322
// if the return value is reactive and deep:true
323323
// watch for changes, this might happen when new key is added
324-
if (isReactive(watcher.value) && deep) {
324+
if (isReactive(watcher.value) && watcher.value.__ob__?.dep && deep) {
325325
watcher.value.__ob__.dep.addSub({
326326
update() {
327327
// this will force the source to be revaluated and the callback

0 commit comments

Comments
 (0)