From 9e9940046499703ecbcf6df2df5762729e4efd27 Mon Sep 17 00:00:00 2001 From: Junrou Nishida Date: Thu, 19 May 2022 14:43:16 +0900 Subject: [PATCH] fix(plugin): OutputStream#TryGetNext throws if it's not started (#581) --- .../Runtime/Scripts/Unity/OutputStream.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/OutputStream.cs b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/OutputStream.cs index 4294d5e9c..a984fb296 100644 --- a/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/OutputStream.cs +++ b/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/OutputStream.cs @@ -282,6 +282,12 @@ public bool ResetTimestampIfTimedOut(long timestampMicrosec, long timeoutMicrose protected bool CanCallNext(bool allowBlock) { + if (_poller == null) + { + Logger.LogWarning("OutputStreamPoller is not initialized. Call StartPolling before running the CalculatorGraph"); + return false; + } + if (canTestPresence) { if (!allowBlock)