LibGUI: Clear out a GJsonArrayModel if it fails to open the JSON source
This fixes an issue in SystemMonitor where old data would linger in the table views after selecting a process owned by another user. Since we can no longer read /proc/PID/* unless PID belongs to us, we will now present empty views for these processes. :^)
This commit is contained in:
parent
efbdaaaa65
commit
c6170070ed
Notes:
sideshowbarker
2024-07-19 10:25:16 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/c6170070edc
1 changed files with 2 additions and 0 deletions
|
@ -7,6 +7,8 @@ void GJsonArrayModel::update()
|
|||
auto file = CFile::construct(m_json_path);
|
||||
if (!file->open(CIODevice::ReadOnly)) {
|
||||
dbg() << "Unable to open " << file->filename();
|
||||
m_array.clear();
|
||||
did_update();
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue