From 163a8bcec6aaaf7d32dc51cfc182db21599c508a Mon Sep 17 00:00:00 2001 From: V5n Date: Sat, 25 May 2019 23:42:59 +0700 Subject: [PATCH 1/2] Fix Null Runtime bug MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From the issue #2 , in my opinion the creation process of session is not complete so this can explain why `NullReferenceException` is occured. What I have done to fix this is to make sure the session initilization step is completed, before create `SenseManager` By the way, I don't have any Intel Realsense device with me so if you have Intel Realsense device, I need your support to pull this branch and try is it work? Because I have never seen this error before too, so I can't reproduce it by myself. Thank for your further support 😄 --- Assets/IRToolkit/Scripts/DepthCameraManger.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Assets/IRToolkit/Scripts/DepthCameraManger.cs b/Assets/IRToolkit/Scripts/DepthCameraManger.cs index d2f9b1d..8527a62 100644 --- a/Assets/IRToolkit/Scripts/DepthCameraManger.cs +++ b/Assets/IRToolkit/Scripts/DepthCameraManger.cs @@ -25,7 +25,10 @@ void Awake() // Initialize Sense Manager void InititalizeSenseManager() { - senseManager = Session.CreateInstance().CreateSenseManager(); + Session session = Session.CreateInstance() + if (session == null) + throw new System.Exception("Session Initialize Failure!"); + senseManager = sesssion.CreateSenseManager(); if (senseManager == null) throw new System.Exception("Sense Manager Initialize Failure!"); else From ca4780c33577cefd97167bd7ad49739b9386ec23 Mon Sep 17 00:00:00 2001 From: V5n Date: Mon, 1 Jul 2019 23:05:17 +0700 Subject: [PATCH 2/2] Fix syntax error --- Assets/IRToolkit/Scripts/DepthCameraManger.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Assets/IRToolkit/Scripts/DepthCameraManger.cs b/Assets/IRToolkit/Scripts/DepthCameraManger.cs index 8527a62..72ebf51 100644 --- a/Assets/IRToolkit/Scripts/DepthCameraManger.cs +++ b/Assets/IRToolkit/Scripts/DepthCameraManger.cs @@ -28,7 +28,7 @@ void InititalizeSenseManager() Session session = Session.CreateInstance() if (session == null) throw new System.Exception("Session Initialize Failure!"); - senseManager = sesssion.CreateSenseManager(); + senseManager = session.CreateSenseManager(); if (senseManager == null) throw new System.Exception("Sense Manager Initialize Failure!"); else