mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 13:28:11 +00:00
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
1 changed files with 2 additions and 0 deletions
|
@ -7,6 +7,8 @@ void GJsonArrayModel::update()
|
||||||
auto file = CFile::construct(m_json_path);
|
auto file = CFile::construct(m_json_path);
|
||||||
if (!file->open(CIODevice::ReadOnly)) {
|
if (!file->open(CIODevice::ReadOnly)) {
|
||||||
dbg() << "Unable to open " << file->filename();
|
dbg() << "Unable to open " << file->filename();
|
||||||
|
m_array.clear();
|
||||||
|
did_update();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue