From 4780e2598502e432d9aec01aba0f672d72deeae7 Mon Sep 17 00:00:00 2001 From: Dan Done Date: Thu, 16 Dec 2021 10:23:58 +0000 Subject: [PATCH] #21 Fixed null ref on exclusions --- Notes.txt | 6 ++++++ SynoAI/Controllers/CameraController.cs | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Notes.txt b/Notes.txt index 06d6b44..7990c97 100644 --- a/Notes.txt +++ b/Notes.txt @@ -1,3 +1,9 @@ +# Build an image to upload + * Ctrl+Shift+P + * Enter Docker Build + * Enter the name of the image + * Push the image via docker desktop + # Build the docker image * Navigate into SynoAI (cd SynoAI) * docker build -t synoai:0.1 . diff --git a/SynoAI/Controllers/CameraController.cs b/SynoAI/Controllers/CameraController.cs index 099a312..0137c0b 100644 --- a/SynoAI/Controllers/CameraController.cs +++ b/SynoAI/Controllers/CameraController.cs @@ -99,7 +99,7 @@ public async void Get(string id) // Get any predictions that fall within the exclusion zones List> exclusionZonePredictions = new List>(); - if (camera.Exclusions.Count() > 0) + if (camera.Exclusions != null && camera.Exclusions.Count() > 0) { for (int i = 0; i < validPredictions.Count; i++) {