From 43200b1db5ce2c28a1a2d0e82c29d72107479ce8 Mon Sep 17 00:00:00 2001 From: Mark Rowe Date: Mon, 22 May 2017 14:33:39 -0700 Subject: [PATCH] Update the recently-added `RealmClass::wait_for_download_completion` to use the new object accessor interface. --- src/js_realm.hpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/js_realm.hpp b/src/js_realm.hpp index 2c4e0d20..5d2a0aa4 100644 --- a/src/js_realm.hpp +++ b/src/js_realm.hpp @@ -553,8 +553,9 @@ void RealmClass::wait_for_download_completion(ContextType ctx, FunctionType, static const String encryption_key_string = "encryptionKey"; ValueType encryption_key_value = Object::get_property(ctx, config_object, encryption_key_string); if (!Value::is_undefined(ctx, encryption_key_value)) { - std::string encryption_key = NativeAccessor::to_binary(ctx, encryption_key_value); - config.encryption_key = std::vector(encryption_key.begin(), encryption_key.end()); + NativeAccessor accessor(ctx); + auto encryption_key = accessor.template unbox(encryption_key_value); + config.encryption_key.assign(encryption_key.data(), encryption_key.data() + encryption_key.size()); } Protected thiz(ctx, this_object); @@ -798,4 +799,4 @@ void RealmClass::close(ContextType ctx, FunctionType, ObjectType this_object, } } // js -} // realm \ No newline at end of file +} // realm