Skip to content
This repository has been archived by the owner on Jun 18, 2024. It is now read-only.

Commit

Permalink
Merge pull request #14 from alessandrofama/fix-studio-access-in-cache…
Browse files Browse the repository at this point in the history
…-generation

Prevent cache generation crash due to unavailable Studio System
  • Loading branch information
alessandrofama authored Aug 19, 2023
2 parents 904d7d9 + b31d95e commit f3162ef
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion addons/FMOD/native/src/fmod_studio_editor_module.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -623,6 +623,12 @@ Dictionary FMODStudioEditorModule::get_project_info_from_banks()
String guid = bank_asset->get_guid();
FMOD_GUID fmod_guid{};
FMOD_Studio_ParseID(guid.utf8().get_data(), &fmod_guid);

if (!studio_system)
{
break;
}

studio_system->getBankByID(&fmod_guid, &bank);

if (!FileAccess::file_exists(resource_dirs["banks"].operator godot::String() + guid + ".tres"))
Expand Down Expand Up @@ -766,7 +772,11 @@ Dictionary FMODStudioEditorModule::get_project_info_from_banks()
}

int parameter_count = 0;
studio_system->getParameterDescriptionCount(&parameter_count);

if (studio_system)
{
studio_system->getParameterDescriptionCount(&parameter_count);
}

if (parameter_count > 0)
{
Expand Down

0 comments on commit f3162ef

Please sign in to comment.