you can check for null as below
if(FaultValues!=null)
{
}
if you need to check whether the list having any items
if(FaultValues!=null && FaultValues.Any())
{
}
or
if(FaultValues!=null && FaultValues.Count>0))
{
}
if you need to check for zero items,
First check for null list then check for item count
if( FaultValues!=null && FaultValues.Count==0)
{
}
Quote:
I forgot to mention that list is not a string but List _lstTempSeverityImg; an image
if it is an image then why you need List? do as below
Image temp;
if(temp==null)
{
}