Bug 851897 - Fix crash in mozilla::widget::nsWinMetroUtils::GetActivationURI. r=jimm

This commit is contained in:
Brian R. Bondy 2013-03-18 11:44:16 -04:00
parent 3fff2318d9
commit e2c698846b
2 changed files with 7 additions and 2 deletions

View File

@ -50,7 +50,6 @@ MetroApp::CreateView(ABI::Windows::ApplicationModel::Core::IFrameworkView **aVie
LogFunction();
sFrameworkView = Make<FrameworkView>(this);
*aViewProvider = sFrameworkView.Get();
return !sFrameworkView ? E_FAIL : S_OK;
}
@ -219,6 +218,7 @@ XRE_MetroCoreApplicationRun()
return false;
}
sFrameworkView = Make<FrameworkView>(sMetroApp.Get());
sCoreApp->Run(sMetroApp.Get());
Log(L"Exiting CoreApplication::Run");

View File

@ -412,7 +412,12 @@ nsWinMetroUtils::GetHandPreference(int32_t *aHandPreference)
NS_IMETHODIMP
nsWinMetroUtils::GetActivationURI(nsAString &aActivationURI)
{
MetroApp::GetView()->GetActivationURI(aActivationURI);
FrameworkView *view = MetroApp::GetView();
if (!view) {
NS_WARNING("GetActivationURI used before view is created!");
return NS_OK;
}
view->GetActivationURI(aActivationURI);
return NS_OK;
}