mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 20:57:35 +00:00
LibVT: Don't try to set the window title to invalid UTF-8 text
This commit is contained in:
parent
b8498dc55e
commit
fa712d8aa5
1 changed files with 6 additions and 0 deletions
|
@ -30,6 +30,7 @@
|
|||
#include <AK/StdLibExtras.h>
|
||||
#include <AK/String.h>
|
||||
#include <AK/StringBuilder.h>
|
||||
#include <AK/Utf8View.h>
|
||||
#include <Kernel/KeyCode.h>
|
||||
#include <LibCore/ConfigFile.h>
|
||||
#include <LibCore/MimeData.h>
|
||||
|
@ -408,6 +409,11 @@ void TerminalWidget::paint_event(GUI::PaintEvent& event)
|
|||
|
||||
void TerminalWidget::set_window_title(const StringView& title)
|
||||
{
|
||||
if (!Utf8View(title).validate()) {
|
||||
dbg() << "TerminalWidget: Attempted to set window title to invalid UTF-8 string";
|
||||
return;
|
||||
}
|
||||
|
||||
if (on_title_change)
|
||||
on_title_change(title);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue