From 63a1581e122d1c5d8d379e8f1de71e7f771085fa Mon Sep 17 00:00:00 2001 From: Harvey Ball Date: Mon, 1 Jan 2018 16:23:21 +0000 Subject: [PATCH] fix(UI): check for error with null event camera 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. --- Assets/VRTK/Source/Scripts/Internal/VRTK_UIGraphicRaycaster.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Assets/VRTK/Source/Scripts/Internal/VRTK_UIGraphicRaycaster.cs b/Assets/VRTK/Source/Scripts/Internal/VRTK_UIGraphicRaycaster.cs index 3d3523940..1271fcb13 100644 --- a/Assets/VRTK/Source/Scripts/Internal/VRTK_UIGraphicRaycaster.cs +++ b/Assets/VRTK/Source/Scripts/Internal/VRTK_UIGraphicRaycaster.cs @@ -25,7 +25,7 @@ public class VRTK_UIGraphicRaycaster : GraphicRaycaster public override void Raycast(PointerEventData eventData, List resultAppendList) { - if (canvas == null) + if (canvas == null || eventCamera == null) { return; }