Skip to content
This repository has been archived by the owner on Jan 9, 2022. It is now read-only.

Commit

Permalink
Null feedbacks
Browse files Browse the repository at this point in the history
  • Loading branch information
guillemsunyer-omnidrone committed Nov 17, 2020
1 parent ba64bbd commit 14b5c9f
Show file tree
Hide file tree
Showing 2 changed files with 344 additions and 29 deletions.
12 changes: 11 additions & 1 deletion Editor/Feedbacks/FeedbacksPlayerCE.cs
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,11 @@ private void DrawFeedbacksSection()
{
Feedback currFeedback = feedbacksProperty.GetArrayElementAtIndex(i).objectReferenceValue as Feedback;

if (currFeedback == null)
{
continue;
}

FeedbackEditorData feedbackEditorData = GetOrCreateFeedbackeEditor(currFeedback);

DrawFeedback(feedbackEditorData, i, e);
Expand Down Expand Up @@ -584,7 +589,7 @@ private void TryRepareFeedbacks()
{
Debug.LogError($"{nameof(Feedback)} is null and could not be repared");

RemoveFeedback(currFeedback);
continue;
}

bool needsToBeRecreated = currFeedback.gameObject == null;
Expand Down Expand Up @@ -630,6 +635,11 @@ private FeedbackEditorData GetOrCreateFeedbackeEditor(Feedback feedback)

private void RemoveFeedbackEditor(Feedback feedback)
{
if (feedback == null)
{
return;
}

cachedEditorFeedback.Remove(feedback);
}

Expand Down
Loading

0 comments on commit 14b5c9f

Please sign in to comment.