diff --git a/object_accessor.hpp b/object_accessor.hpp index dfb24f69..fa6d6366 100644 --- a/object_accessor.hpp +++ b/object_accessor.hpp @@ -98,6 +98,10 @@ namespace realm { { using Accessor = NativeAccessor; + if (!realm->is_in_transaction()) { + throw std::runtime_error("Can only set property values within a transaction."); + } + size_t column = property.table_column; switch (property.type) { case PropertyTypeBool: