Add checks to handle failure in creating entity as a child of a read-only entity in TrackView and LandscapeCanvas (#7156)

Signed-off-by: Danilo Aimini <82231674+AMZN-daimini@users.noreply.github.com>
This commit is contained in:
Danilo Aimini
2022-01-25 21:09:00 -08:00
committed by GitHub
parent 56e7e70735
commit e6113eb9c5
3 changed files with 42 additions and 1 deletions
+6 -1
View File
@@ -1046,7 +1046,12 @@ void CTrackViewDialog::OnAddSequence()
AzToolsFramework::ScopedUndoBatch undoBatch("Create TrackView Director Node");
sequenceManager->CreateSequence(sequenceName, sequenceType);
CTrackViewSequence* newSequence = sequenceManager->GetSequenceByName(sequenceName);
AZ_Assert(newSequence, "Creating new sequence failed.");
if (!newSequence)
{
return;
}
undoBatch.MarkEntityDirty(newSequence->GetSequenceComponentEntityId());
// make it the currently selected sequence