From a43a749b9c0dc14a2e57d0b0544f7b59c82cfff3 Mon Sep 17 00:00:00 2001 From: BuckarooBanzay Date: Mon, 16 Oct 2023 14:52:09 +0200 Subject: [PATCH] check for `nil` area entry --- main.go | 3 +++ process_export_protected.go | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/main.go b/main.go index 6b11796..4cbf9c3 100644 --- a/main.go +++ b/main.go @@ -61,6 +61,9 @@ func main() { logrus.WithFields(logrus.Fields{"filename": areas_file}).Warn("Areas not found") } else { for _, area := range areas { + if area == nil { + continue + } PopulateAreaProtection(area) } } diff --git a/process_export_protected.go b/process_export_protected.go index c3049eb..bada586 100644 --- a/process_export_protected.go +++ b/process_export_protected.go @@ -44,6 +44,10 @@ func ProcessExportProtected(areas []*areasparser.Area) error { chunk_count := 0 for _, area := range areas { + if area == nil { + continue + } + chunk1_x, chunk1_y, chunk1_z := GetChunkPosFromNode(area.Pos1.X, area.Pos1.Y, area.Pos1.Z) chunk2_x, chunk2_y, chunk2_z := GetChunkPosFromNode(area.Pos2.X, area.Pos2.Y, area.Pos2.Z)