From 21a6b1c5e885bdd5e4b3cabbdac4d5c0f92da800 Mon Sep 17 00:00:00 2001 From: ikpil Date: Thu, 27 Jul 2023 13:01:20 +0900 Subject: [PATCH] null check --- src/DotRecast.Recast.DemoTool/Tools/TileToolImpl.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/DotRecast.Recast.DemoTool/Tools/TileToolImpl.cs b/src/DotRecast.Recast.DemoTool/Tools/TileToolImpl.cs index 3cc1f7b..8918552 100644 --- a/src/DotRecast.Recast.DemoTool/Tools/TileToolImpl.cs +++ b/src/DotRecast.Recast.DemoTool/Tools/TileToolImpl.cs @@ -26,6 +26,9 @@ namespace DotRecast.Recast.DemoTool.Tools var settings = _sample.GetSettings(); var geom = _sample.GetInputGeom(); var navMesh = _sample.GetNavMesh(); + + if (null == settings || null == geom || navMesh == null) + return; float ts = settings.tileSize * settings.cellSize; @@ -44,6 +47,9 @@ namespace DotRecast.Recast.DemoTool.Tools var geom = _sample.GetInputGeom(); var navMesh = _sample.GetNavMesh(); + if (null == settings || null == geom || navMesh == null) + return; + float ts = settings.tileSize * settings.cellSize; var bmin = geom.GetMeshBoundsMin();