From 966c86a6b508735d587af179835e54eea4bcf46c Mon Sep 17 00:00:00 2001 From: gucio321 Date: Fri, 30 Apr 2021 17:55:52 +0200 Subject: [PATCH] itemTypeLoader: wrap panic, which occures, when a wrong version of patch_d2 is there --- d2core/d2records/item_types_loader.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/d2core/d2records/item_types_loader.go b/d2core/d2records/item_types_loader.go index e278e0b6..66387ad2 100644 --- a/d2core/d2records/item_types_loader.go +++ b/d2core/d2records/item_types_loader.go @@ -1,6 +1,8 @@ package d2records import ( + "log" + "github.com/OpenDiablo2/OpenDiablo2/d2common/d2enum" "github.com/OpenDiablo2/OpenDiablo2/d2common/d2fileformats/d2txt" ) @@ -125,6 +127,10 @@ func updateEquivalencies( itemType *ItemTypeRecord, checked []string, ) { + if itemType == nil { + log.Fatal("invalid data file. Please ensure, yo're using the newest patch_d2.mpq file!") + } + if itemType.Code == "" { return }