diff --git a/Content.Server/Instruments/InstrumentSystem.cs b/Content.Server/Instruments/InstrumentSystem.cs index ece7c1252d..da509f2a7f 100644 --- a/Content.Server/Instruments/InstrumentSystem.cs +++ b/Content.Server/Instruments/InstrumentSystem.cs @@ -67,6 +67,9 @@ public sealed partial class InstrumentSystem : SharedInstrumentSystem private void OnBoundUIClosed(EntityUid uid, InstrumentComponent component, BoundUIClosedEvent args) { + if (args.UiKey is not InstrumentUiKey) + return; + if (HasComp(uid) && _userInterfaceSystem.TryGetUi(uid, args.UiKey, out var bui) && bui.SubscribedSessions.Count == 0) @@ -79,6 +82,9 @@ public sealed partial class InstrumentSystem : SharedInstrumentSystem private void OnBoundUIOpened(EntityUid uid, InstrumentComponent component, BoundUIOpenedEvent args) { + if (args.UiKey is not InstrumentUiKey) + return; + EnsureComp(uid); Clean(uid, component); }