core: check return value of map.metadata

Even though the call of map.metadata is known to always return a valid
pointer (because the meta data is assigned in the code just above),
better add an explicit nullptr check.
This commit is contained in:
Norman Feske 2020-01-02 20:52:49 +01:00
parent 783c05fd6c
commit de52cf1cdd
1 changed files with 3 additions and 2 deletions

View File

@ -445,10 +445,11 @@ Region_map_component::attach(Dataspace_capability ds_cap, size_t size,
error("failed to store attachment info");
throw Invalid_dataspace();
}
Rm_region &region = *_map.metadata(attach_at);
/* inform dataspace about attachment */
dsc->attached_to(region);
Rm_region * const region_ptr = _map.metadata(attach_at);
if (region_ptr)
dsc->attached_to(*region_ptr);
/* check if attach operation resolves any faulting region-manager clients */
_faulters.for_each([&] (Rm_faulter &faulter) {