diff options
-rw-r--r-- | include/erebos/storage.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/include/erebos/storage.h b/include/erebos/storage.h index 735b399..62619a2 100644 --- a/include/erebos/storage.h +++ b/include/erebos/storage.h @@ -657,7 +657,8 @@ WatchedHead<T> Head<T>::watch(const std::function<void(const Head<T> &)> & watch template<typename T> Bhv<T> Head<T>::behavior() const { - return make_shared<HeadBhv<T>>(*this); + auto cur = ref().storage().template head<T>(id()); + return make_shared<HeadBhv<T>>(cur ? *cur : *this); } template<class T> |