Merge pull request #15019 from AndrewMeadows/fix-crash-after-avatar-upload

Case 21422: fix crash for nullptr deref when looking at recently uploaded avatar in inventory
This commit is contained in:
Shannon Romano 2019-03-01 09:35:01 -08:00 committed by GitHub
commit 1084e79a2e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -254,11 +254,15 @@ void AvatarProject::openInInventory() const {
DependencyManager::get<TabletScriptingInterface>()->getTablet("com.highfidelity.interface.tablet.system"));
tablet->loadQMLSource("hifi/commerce/wallet/Wallet.qml");
DependencyManager::get<HMDScriptingInterface>()->openTablet();
tablet->getTabletRoot()->forceActiveFocus();
auto name = getProjectName();
// I'm not a fan of this, but it's the only current option.
auto name = getProjectName();
QTimer::singleShot(TIME_TO_WAIT_FOR_INVENTORY_TO_OPEN_MS, [name, tablet]() {
tablet->sendToQml(QVariantMap({ { "method", "updatePurchases" }, { "filterText", name } }));
});
QQuickItem* root = tablet->getTabletRoot();
if (root) {
root->forceActiveFocus();
}
}