mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-01-30 21:04:48 +00:00
Modifies SetupInputCards() to try to fix a NullReferenceException being thrown. Adds a debug statement to check if a given card in the collection can't be cast as DMInput.
This commit is contained in:
@@ -213,10 +213,10 @@ namespace PepperDash.Essentials.DM
|
||||
{
|
||||
var inputCard = card as DMInput;
|
||||
|
||||
Debug.Console(1, this, "Adding Input Card Number {0} Type: {1}", inputCard.Number, inputCard.CardInputOutputType.ToString());
|
||||
|
||||
if (inputCard != null)
|
||||
{
|
||||
Debug.Console(1, this, "Adding Input Card Number {0} Type: {1}", inputCard.Number, inputCard.CardInputOutputType.ToString());
|
||||
|
||||
InputEndpointOnlineFeedbacks[inputCard.Number] = new BoolFeedback(() => { return inputCard.EndpointOnlineFeedback; });
|
||||
|
||||
if (inputCard.VideoDetectedFeedback != null)
|
||||
@@ -226,12 +226,13 @@ namespace PepperDash.Essentials.DM
|
||||
return inputCard.VideoDetectedFeedback.BoolValue;
|
||||
});
|
||||
}
|
||||
|
||||
InputNameFeedbacks[inputCard.Number] = new StringFeedback(() =>
|
||||
{
|
||||
if (inputCard.NameFeedback != null && !string.IsNullOrEmpty(inputCard.NameFeedback.StringValue))
|
||||
{
|
||||
Debug.Console(2, this, "Input Card {0} Name: {1}", inputCard.Number, inputCard.NameFeedback.StringValue);
|
||||
return inputCard.NameFeedback.StringValue;
|
||||
return inputCard.NameFeedback.StringValue;
|
||||
|
||||
}
|
||||
else
|
||||
@@ -240,9 +241,13 @@ namespace PepperDash.Essentials.DM
|
||||
return "";
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
AddInputCard(inputCard.Number, inputCard);
|
||||
AddInputCard(inputCard.Number, inputCard);
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.Console(2, this, "***********Input Card of type {0} is cannot be cast as DMInput*************", card.CardInputOutputType);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user