mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-01-07 04:00:37 -06:00
Merge pull request #2997 from OpenSpace/issue/2976
Fix for crash when reading meta of corrupt config file
This commit is contained in:
@@ -588,10 +588,17 @@ bool handleConfigurationFile(QComboBox& box, const std::filesystem::directory_en
|
||||
|
||||
// Add tooltip
|
||||
if (isJson) {
|
||||
sgct::config::Meta meta = sgct::readMeta(p.path().string(), true);
|
||||
if (!meta.description.empty()) {
|
||||
std::string tooltipDescription;
|
||||
try {
|
||||
sgct::config::Meta meta = sgct::readMeta(p.path().string());
|
||||
tooltipDescription = meta.description;
|
||||
}
|
||||
catch (const sgct::Error&) {
|
||||
tooltipDescription = "(no description available)";
|
||||
}
|
||||
if (!tooltipDescription.empty()) {
|
||||
QString toolTip = QString::fromStdString(
|
||||
fmt::format("<p>{}</p>", meta.description)
|
||||
fmt::format("<p>{}</p>", tooltipDescription)
|
||||
);
|
||||
box.setItemData(box.count() - 1, toolTip, Qt::ToolTipRole);
|
||||
}
|
||||
|
||||
Submodule apps/OpenSpace/ext/sgct updated: e2e1b99a2d...9ee34038be
Reference in New Issue
Block a user