kern: implement SvcUnmapMemory, more of SvcGetInfo

This commit is contained in:
Michael Scire
2020-05-29 00:57:25 -07:00
parent faad5609b9
commit 1a0696f8a3
14 changed files with 231 additions and 37 deletions

View File

@@ -147,7 +147,11 @@ namespace ams::kern {
if constexpr (std::is_same<T, KAutoObject>::value) {
return this->GetObjectImpl(handle);
} else {
return this->GetObjectImpl(handle)->DynamicCast<T*>();
if (auto *obj = this->GetObjectImpl(handle); obj != nullptr) {
return obj->DynamicCast<T*>();
} else {
return nullptr;
}
}
}
@@ -177,7 +181,11 @@ namespace ams::kern {
if constexpr (std::is_same<T, KAutoObject>::value) {
return obj;
} else {
return obj->DynamicCast<T*>();
if (auto *obj = this->GetObjectImpl(handle); obj != nullptr) {
return obj->DynamicCast<T*>();
} else {
return nullptr;
}
}
}