Skip to content

Commit 88afe8f

Browse files
committed
added error handling for the mirror
1 parent 09d9e7f commit 88afe8f

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

Basis/Packages/com.basis.examples/Scripts/BasisSDKMirror.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,11 @@ private void GetEffectiveResolution(out int width, out int height)
234234
private void Initialize()
235235
{
236236
if (IsActive) return;
237+
if (Renderer == null)
238+
{
239+
BasisDebug.LogError("BasisSDKMirror is missing its Renderer reference; mirror will not initialize.");
240+
return;
241+
}
237242

238243
// Drop any stale cameras/textures from a prior init that didn't reach a clean teardown
239244
// (e.g. resources orphaned across a Play-Mode domain reload).

0 commit comments

Comments
 (0)