Skip to content

Commit

Permalink
fix(watch): check if __ob__ has value before addSub (#477)
Browse files Browse the repository at this point in the history
  • Loading branch information
pikax committed Aug 15, 2020
1 parent 01ca6ff commit d8cd30d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/apis/watch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ function createWatcher(

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

0 comments on commit d8cd30d

Please sign in to comment.