fix: resolve critical bugs #4 #5 #6 #8 #30

Merged
lavarius merged 2 commits from fix/critical-bugs into master 2026-03-12 01:35:13 +00:00
Collaborator

Fixes bugs #4, #5, #6, #8.

Changes

#8MainCameraInstance: Missing DontDestroyOnLoad

  • Added DontDestroyOnLoad(gameObject) in Awake when setting the singleton
  • Added Destroy(gameObject) for duplicate instances (matching the standard singleton pattern)

#5CameraManager: Instantiate called every LateUpdate frame

  • Moved Instantiate(CameraPrefab) from LateUpdate to Awake — runs exactly once, stops the infinite GameObject leak

#6SlideUpWindow: Empty catch block silently swallows exceptions

  • Replaced empty catch with catch (Exception e) + Debug.LogError(...) so errors are visible

#4ChatProcessor: GetChild(0) throws if container is empty

  • Added childCount == 0 guard after ShiftChildrenUp() in both HandleTwitchMessage and HandleChatMessage
Fixes bugs #4, #5, #6, #8. ## Changes ### #8 — `MainCameraInstance`: Missing `DontDestroyOnLoad` - Added `DontDestroyOnLoad(gameObject)` in `Awake` when setting the singleton - Added `Destroy(gameObject)` for duplicate instances (matching the standard singleton pattern) ### #5 — `CameraManager`: `Instantiate` called every `LateUpdate` frame - Moved `Instantiate(CameraPrefab)` from `LateUpdate` to `Awake` — runs exactly once, stops the infinite GameObject leak ### #6 — `SlideUpWindow`: Empty catch block silently swallows exceptions - Replaced empty `catch` with `catch (Exception e)` + `Debug.LogError(...)` so errors are visible ### #4 — `ChatProcessor`: `GetChild(0)` throws if container is empty - Added `childCount == 0` guard after `ShiftChildrenUp()` in both `HandleTwitchMessage` and `HandleChatMessage`
- MainCameraInstance: add DontDestroyOnLoad + destroy duplicate (fix #8)
- CameraManager: move Instantiate from LateUpdate to Awake (fix #5)
- SlideUpWindow: replace silent catch with Debug.LogError (fix #6)
- ChatProcessor: guard GetChild(0) with childCount check in both handlers (fix #4)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
lavarius approved these changes 2026-03-12 01:35:01 +00:00
lavarius merged commit 59f17717dd into master 2026-03-12 01:35:13 +00:00
lavarius deleted branch fix/critical-bugs 2026-03-12 01:35:13 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
lavarius/ProjectOverlay!30
No description provided.