1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-25 07:44:38 +01:00

Prevent some crashes when title sequence is not present

This commit is contained in:
Michał Janiszewski
2017-01-28 22:13:36 +01:00
committed by Ted John
parent f6cc743da6
commit 723e13cb16
2 changed files with 13 additions and 2 deletions

View File

@@ -82,6 +82,10 @@ namespace TitleSequenceManager
void DeleteItem(size_t i)
{
auto item = GetItem(i);
if (item == nullptr)
{
return;
}
const utf8 * path = item->Path.c_str();
if (item->IsZip)
{
@@ -295,6 +299,10 @@ extern "C"
const utf8 * title_sequence_manager_get_name(size_t index)
{
auto item = TitleSequenceManager::GetItem(index);
if (item == nullptr)
{
return nullptr;
}
const utf8 * name = item->Name.c_str();
return name;
}