avoid nullptr deref

This commit is contained in:
Andrew Meadows 2019-02-25 13:52:46 -08:00
parent dc6bdfae8a
commit 6e13203fec

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();
}
}