mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 20:28:11 +00:00
DisplaySettings: Handle case where there is no DPI value
DisplaySettings uses the optional `screen_dpi` value before checking if it is set, causing an assertion failure. This change moves the usage into the block where it is known to be set. One situation where this is known to occur is on real hardware when using the MULTIBOOT_VIDEO_MODE multiboot flag to enable graphical display output.
This commit is contained in:
parent
bd7bd1d677
commit
dfbc2839b4
1 changed files with 3 additions and 3 deletions
|
@ -214,10 +214,10 @@ ErrorOr<void> MonitorSettingsWidget::selected_screen_index_or_resolution_changed
|
|||
}
|
||||
}
|
||||
|
||||
auto dpi_label_value = String::formatted("{} dpi", screen_dpi.value());
|
||||
if (screen_dpi.has_value() && !dpi_label_value.is_error()) {
|
||||
if (screen_dpi.has_value()) {
|
||||
auto dpi_label_value = TRY(String::formatted("{} dpi", screen_dpi.value()));
|
||||
m_dpi_label->set_tooltip(screen_dpi_tooltip.to_deprecated_string());
|
||||
m_dpi_label->set_text(dpi_label_value.release_value());
|
||||
m_dpi_label->set_text(move(dpi_label_value));
|
||||
m_dpi_label->set_visible(true);
|
||||
} else {
|
||||
m_dpi_label->set_visible(false);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue