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

Prevent cache generation crash due to unavailable Studio System #14

Merged
merged 1 commit into from
Aug 19, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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