Skip to content

Commit a4bcde2

Browse files
committed
Fixed possible windows crash
1 parent f59c6ce commit a4bcde2

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

src/port/importer/AssetArrayFactory.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,12 @@ ResourceFactoryBinaryAssetArrayV0::ReadResource(std::shared_ptr<Ship::File> file
1818

1919
auto count = reader->ReadUInt32();
2020
for (size_t i = 0; i < count; i++) {
21-
auto asset = Ship::Context::GetInstance()->GetResourceManager()->LoadResource(reader->ReadUInt64());
21+
auto path = ResourceGetNameByCrc(reader->ReadUInt64());
22+
if (path == nullptr) {
23+
array->mPtrs.push_back(0);
24+
continue;
25+
}
26+
auto asset = Ship::Context::GetInstance()->GetResourceManager()->LoadResourceProcess(path);
2227
if (asset != nullptr) {
2328
auto data = asset->GetInitData();
2429
if (data->Type == (uint32_t)Fast::ResourceType::Texture) {

0 commit comments

Comments
 (0)