File tree Expand file tree Collapse file tree 2 files changed +4
-2
lines changed
libraries/chain/webassembly Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -213,7 +213,8 @@ namespace eosio { namespace chain { namespace webassembly {
213213 }
214214
215215 bool interface::is_privileged ( account_name n ) const {
216- return context.db .get <account_metadata_object, by_name>( n ).is_privileged ();
216+ auto const *account_metadata = context.db .find <account_metadata_object, by_name>( n );
217+ return account_metadata != nullptr && account_metadata->is_privileged ();
217218 }
218219
219220 void interface::set_privileged ( account_name n, bool is_priv ) {
Original file line number Diff line number Diff line change @@ -218,7 +218,8 @@ class eos_vm_profiling_module : public wasm_instantiated_module_interface {
218218 if (auto it = _prof.find (account); it != _prof.end ()) {
219219 return it->second .get ();
220220 } else {
221- auto code_sequence = context.control .db ().get <account_metadata_object, by_name>(account).code_sequence ;
221+ auto const *account_metadata = context.control .db ().find <account_metadata_object, by_name>(account);
222+ auto code_sequence = account_metadata != nullptr ? account_metadata->code_sequence : 0 ;
222223 std::string basename = account.to_string () + " ." + std::to_string (code_sequence);
223224 auto prof = std::make_unique<profile_data>(basename + " .profile" , *_instantiated_module);
224225 auto [pos,_] = _prof.insert (std::pair{ account, std::move (prof)});
You can’t perform that action at this time.
0 commit comments