mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-04-12 20:17:03 +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:
parent
52c387081c
commit
dd7408dbf1
1 changed files with 10 additions and 5 deletions
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue