Skip to content

Commit 1666a3a

Browse files
authored
Fix BUI EntitySystem injection (space-wizards#6515)
* Disable injection when creating BUI instances (the constructor will take care of it) * Comment * Release note
1 parent 3c53379 commit 1666a3a

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

RELEASE-NOTES.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ END TEMPLATE-->
4343

4444
### Bugfixes
4545

46-
*None yet*
46+
* Fixed `EntitySystem` dependencies throwing an exception when opening a BUI.
4747

4848
### Other
4949

Robust.Shared/GameObjects/Systems/SharedUserInterfaceSystem.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -536,7 +536,8 @@ private void EnsureClientBui(Entity<UserInterfaceComponent> entity, Enum key, In
536536
// states. E.g., stripping UI used to throw NREs in some instances while fetching the identity of unknown
537537
// entities.
538538
var type = _reflection.LooseGetType(data.ClientType);
539-
var boundUserInterface = (BoundUserInterface) _factory.CreateInstance(type, [entity.Owner, key]);
539+
// No dependency injection because the BUI constructor will handle it.
540+
var boundUserInterface = (BoundUserInterface) _factory.CreateInstance(type, [entity.Owner, key], inject: false);
540541
entity.Comp.ClientOpenInterfaces[key] = boundUserInterface;
541542

542543
// This is just so we don't open while applying UI states.

0 commit comments

Comments
 (0)