Fixes exceptions in Eisc_SigChange by checking uo for null first. Then fixes issue where if output card is Card.Dmps3CodecOutput the NameFeedback property throws a null ref exception, even if you first check it for null.

This commit is contained in:
Neil Dorin
2019-07-30 14:19:01 -06:00
parent bdf3e2054f
commit 59b2995a1b
3 changed files with 58 additions and 25 deletions

View File

@@ -162,7 +162,7 @@ namespace PepperDash.Essentials.DM
OutputNameFeedbacks[outputCard.Number] = new StringFeedback(() =>
{
if (outputCard.NameFeedback != null)
if (outputCard.NameFeedback != null && !string.IsNullOrEmpty(outputCard.NameFeedback.StringValue))
{
Debug.Console(2, this, "Output Card {0} Name: {1}", outputCard.Number, outputCard.NameFeedback.StringValue);
return outputCard.NameFeedback.StringValue;
@@ -557,12 +557,12 @@ namespace PepperDash.Essentials.DM
AudioOutputFeedbacks[output].FireUpdate();
}
}
//else if (args.EventId == DMOutputEventIds.OutputNameEventId
// && OutputNameFeedbacks.ContainsKey(output))
//{
// Debug.Console(2, this, "DM Output {0} NameFeedbackEventId", output);
// OutputNameFeedbacks[output].FireUpdate();
//}
else if (args.EventId == DMOutputEventIds.OutputNameEventId
&& OutputNameFeedbacks.ContainsKey(output))
{
Debug.Console(2, this, "DM Output {0} NameFeedbackEventId", output);
OutputNameFeedbacks[output].FireUpdate();
}
}