AppLauncher: Fix potential crash

pull/239/head
Peter Repukat 1 year ago
parent 6c0a6145ec
commit 0745e3684d

@ -251,9 +251,11 @@ void AppLauncher::getProcessHwnds()
IPropertyStore* propStore;
SHGetPropertyStoreForWindow(curr_wnd, IID_IPropertyStore, reinterpret_cast<void**>(&propStore));
PROPVARIANT prop;
propStore->GetValue(PKEY_AppUserModel_ID, &prop);
if (prop.bstrVal != nullptr && std::wstring(prop.bstrVal) == launched_uwp_path_) {
process_hwnds_.push_back(curr_wnd);
if (propStore != nullptr) {
propStore->GetValue(PKEY_AppUserModel_ID, &prop);
if (prop.bstrVal != nullptr && std::wstring(prop.bstrVal) == launched_uwp_path_) {
process_hwnds_.push_back(curr_wnd);
}
}
} while (curr_wnd != nullptr);
}

Loading…
Cancel
Save