Skip to content

Commit

Permalink
check for nil area entry
Browse files Browse the repository at this point in the history
  • Loading branch information
BuckarooBanzay committed Oct 16, 2023
1 parent cdc40cc commit a43a749
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}
Expand Down
4 changes: 4 additions & 0 deletions process_export_protected.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit a43a749

Please sign in to comment.