1
0
Fork 0

Fix a crash when package data is missing

This may explain some of the erratic startup crashes, due to the
master catalog being out of date for 2018.*
This commit is contained in:
James Turner 2018-02-27 11:33:31 +00:00
parent a6718cc73d
commit 4f96039e70

View file

@ -488,7 +488,9 @@ void QmlAircraftInfo::setUri(QUrl u)
auto ident = u.path().toStdString();
try {
_package = globals->packageRoot()->getPackageById(ident);
_variant = _package->indexOfVariant(ident);
if (_package) {
_variant = _package->indexOfVariant(ident);
}
} catch (sg_exception&) {
qWarning() << "couldn't find package/variant for " << u;
}