Skip to content

Commit

Permalink
fix(UI): check for error with null event camera
Browse files Browse the repository at this point in the history
When working with additive scenes there is null exception if:

- first scene has a UICanvas, but no camera
- second scene is the one with a camera

As soon as the first scene is loaded, the raycast gives an error
because trying to do an update but there is no camera.
The error stops after the second scene is loaded.

Thanks to @interillusion for the fix.
  • Loading branch information
thestonefox committed Jan 1, 2018
1 parent 83c654a commit 63a1581
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public class VRTK_UIGraphicRaycaster : GraphicRaycaster

public override void Raycast(PointerEventData eventData, List<RaycastResult> resultAppendList)
{
if (canvas == null)
if (canvas == null || eventCamera == null)
{
return;
}
Expand Down

0 comments on commit 63a1581

Please sign in to comment.