mirror of
https://github.com/fairyglade/ly.git
synced 2025-12-20 19:24:53 +00:00
Fix potential out of bounds issue when automatically changing session
Signed-off-by: AnErrupTion <anerruption@disroot.org>
This commit is contained in:
@@ -67,6 +67,7 @@ pub fn getCurrentUsername(self: UserList) []const u8 {
|
|||||||
|
|
||||||
fn usernameChanged(user: User, maybe_session: ?*Session) void {
|
fn usernameChanged(user: User, maybe_session: ?*Session) void {
|
||||||
if (maybe_session) |session| {
|
if (maybe_session) |session| {
|
||||||
|
if (user.session_index.* >= session.label.list.items.len) return;
|
||||||
session.label.current = user.session_index.*;
|
session.label.current = user.session_index.*;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user