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:
parent
a6718cc73d
commit
4f96039e70
1 changed files with 3 additions and 1 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue