Skip to content

systemd: guard against currentIdentifiers being undefined #22038

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 27, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pkg/systemd/logsJournal.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ export class JournalBox extends React.Component {
const serviceTag = entries[i].SYSLOG_IDENTIFIER;
this.renderer.prepend(entries[i]);
// Only update if the service is not yet known
if (serviceTag && !this.props.currentIdentifiers.includes(serviceTag))
if (serviceTag && !this.props.currentIdentifiers?.includes(serviceTag))
// Due to asynchronous nature it needs to be checked whether this
// identifier is not yet defined. The previous check could be omitted
// and only this one used but let's try to trigger as few updates as possible
Expand Down
1 change: 1 addition & 0 deletions pkg/systemd/services.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ class ServicesPageBody extends React.Component {
/* State related to the toolbar components */
isFullyLoaded: false,
error: null,
pinnedUnits: [],
};

/* data storage
Expand Down
Loading