From 06f8b6db9eedeea5dc5f717461871cfd40c3e113 Mon Sep 17 00:00:00 2001 From: Martin Benjamins Date: Sat, 31 Aug 2024 14:32:59 +0200 Subject: [PATCH] Check if WMO MGI2 exists first --- Controllers/ModelController.cs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Controllers/ModelController.cs b/Controllers/ModelController.cs index 7ff2605..2f1b11b 100644 --- a/Controllers/ModelController.cs +++ b/Controllers/ModelController.cs @@ -38,8 +38,13 @@ public string Info(int fileDataID) returnString += ""; returnString += "Group"; returnString += "Flags: " + group.flags + ""; - returnString += "Flags2: " + wmo.groupInfo2[i].flags2 + ""; - returnString += "'lodIndex' " + wmo.groupInfo2[i].lodIndex + ""; + + if(wmo.groupInfo2 != null) + { + returnString += "Flags2: " + wmo.groupInfo2[i].flags2 + ""; + returnString += "'lodIndex' " + wmo.groupInfo2[i].lodIndex + ""; + } + returnString += ""; }