Correctly manage the case of string=nil if wreng_string_t is string_view

This commit is contained in:
King_DuckZ 2022-04-29 02:09:12 +02:00
commit 10e3c9adac
2 changed files with 19 additions and 2 deletions

View file

@ -47,7 +47,8 @@ namespace wren {
auto cb = static_cast<detail::Callbacks*>(wrenGetUserData(wvm));
assert(cb);
assert(cb->error_fn and cb->config_obj and cb->owner);
cb->error_fn(*cb->config_obj, cb->owner, to_error_type(type), module, line, message);
const char* const sane_module = (module ? module : "");
cb->error_fn(*cb->config_obj, cb->owner, to_error_type(type), sane_module, line, message);
}
const char* resolve_module_fn (WrenVM* wvm, const char* importer, const char* name) {