[RAPPS] Fix of unhandled exception when trying to modify/uninstall without selection (#3185)

CORE-17279
This commit is contained in:
Kyle Katarn 2020-09-15 22:50:12 +02:00 committed by GitHub
parent a27f0debca
commit 579f501215
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -278,6 +278,9 @@ BOOL CMainWindow::RemoveSelectedAppFromRegistry()
if (MessageBoxW(szMsgText, szMsgTitle, MB_YESNO | MB_ICONQUESTION) == IDYES)
{
CInstalledApplicationInfo *InstalledApp = (CInstalledApplicationInfo *)m_ApplicationView->GetFocusedItemData();
if (!InstalledApp)
return FALSE;
LSTATUS Result = InstalledApp->RemoveFromRegistry();
if (Result != ERROR_SUCCESS)
{
@ -299,6 +302,8 @@ BOOL CMainWindow::UninstallSelectedApp(BOOL bModify)
return FALSE;
CInstalledApplicationInfo *InstalledApp = (CInstalledApplicationInfo *)m_ApplicationView->GetFocusedItemData();
if (!InstalledApp)
return FALSE;
return InstalledApp->UninstallApplication(bModify);
}