Skip to content

Commit

Permalink
🐛 bug(observer): fix dep undefined error (#88) by @fandaa
Browse files Browse the repository at this point in the history
  • Loading branch information
František Polášek authored and kazupon committed Nov 19, 2016
1 parent 8e6d154 commit 724974e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export default function (Vue, langVM, lang) {

return function computedGetter () {
watcher.dirty && watcher.evaluate()
Dep.target && watcher.depend()
Dep && Dep.target && watcher.depend()
return watcher.value
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/observer.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ let Dep
*/

export function getDep (vm) {
if (!Dep) {
if (!Dep && vm && vm._data && vm._data.__ob__ && vm._data.__ob__.dep) {
Dep = vm._data.__ob__.dep.constructor
}
return Dep
Expand Down

0 comments on commit 724974e

Please sign in to comment.