Add missing null pointer checks

I did double check, and I don't think any of these are supposed to be
nullable.
This commit is contained in:
Robbert van der Helm
2021-01-08 18:19:23 +01:00
parent 2fc7621aee
commit 07a994089b
3 changed files with 265 additions and 125 deletions
@@ -43,13 +43,20 @@ Vst3HostContextProxyImpl::queryInterface(const Steinberg::TUID _iid,
tresult PLUGIN_API
Vst3HostContextProxyImpl::getName(Steinberg::Vst::String128 name) {
const GetNameResponse response = bridge.send_message(
YaHostApplication::GetName{.owner_instance_id = owner_instance_id()});
if (name) {
const GetNameResponse response =
bridge.send_message(YaHostApplication::GetName{
.owner_instance_id = owner_instance_id()});
std::copy(response.name.begin(), response.name.end(), name);
name[response.name.size()] = 0;
std::copy(response.name.begin(), response.name.end(), name);
name[response.name.size()] = 0;
return response.result;
return response.result;
} else {
bridge.logger.log(
"WARNING: Null pointer passed to 'IHostApplication::getName()'");
return Steinberg::kInvalidArgument;
}
}
tresult PLUGIN_API