mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 15:27:35 +00:00
DisplaySettings: Don't crash after 'pape'
Running 'pape' without arguments (or just editing the WindowServer.ini by hand) can confuse DisplaySettings. Specifically, if the 'Wallpaper' is set to '/res/wallpapers/', then DisplaySettings used to crash because 'name_parts' wouldn't contain any trailing element. It's hard to define desired behavior, but this is better than crashing and confusing the user.
This commit is contained in:
parent
1b140d1b5b
commit
5d3ac4ec9e
1 changed files with 1 additions and 1 deletions
|
@ -275,7 +275,7 @@ void DisplaySettingsWidget::load_current_settings()
|
|||
|
||||
Optional<size_t> optional_index;
|
||||
if (selected_wallpaper.starts_with("/res/wallpapers/")) {
|
||||
auto name_parts = selected_wallpaper.split('/');
|
||||
auto name_parts = selected_wallpaper.split('/', true);
|
||||
optional_index = m_wallpapers.find_first_index(name_parts[2]);
|
||||
|
||||
if (optional_index.has_value()) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue