From 6b1b9656f612b7a79bb4fdaa7d3810e919b7d43a Mon Sep 17 00:00:00 2001 From: F David Date: Tue, 3 Nov 2026 21:55:40 +0100 Subject: [PATCH] Fix crash from adding priority (#584) --- src/Views/LogView/SystemdLogModel.vala | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/Views/LogView/SystemdLogModel.vala b/src/Views/LogView/SystemdLogModel.vala index f0b8b2fa8..74b8164d7 100644 --- a/src/Views/LogView/SystemdLogModel.vala +++ b/src/Views/LogView/SystemdLogModel.vala @@ -163,7 +163,13 @@ public class Monitor.SystemdLogModel : GLib.Object, GLib.ListModel, Gtk.SectionM var dt = new DateTime.from_unix_utc ((int64) (time / TimeSpan.SECOND)); - var entry = new SystemdLogEntry (origin, message, dt, (Systemd.Journal.Priority) int.parse (priority)); + int numeric_priority = -1; + if (priority != null) { + numeric_priority = int.parse (priority); + } else { + debug ("Unable to read priority from: %s (message: %s)", origin, message); + } + var entry = new SystemdLogEntry (origin, message, dt, (Systemd.Journal.Priority) numeric_priority); // Filter if we're searching. We drop them and don't add them and use a filter model // because when searching for e.g. a non existent term this would fill up memory *quick*