return value only when it is not null else recheck it..... c#
Return the value only when it is set. if I use a condition to check the
null condition it is throwing a exception. "saying not all code paths
return a value"
private void HandlePinsAvailable(byte[] pinBytes)
{
pinmesssage = Encoding.ASCII.GetString(pinBytes);
}
internal string GetPinMessage(string AccoutNumber)
{
string pinstring = string.Empty;
obj.SendPinRequest(AccoutNumber);
pinstring = pinmesssage;
return pinstring;
}
private string _pinMessafe;
public string pinmesssage
{
get//Not all Code paths return a value
{
if (_pinMessafe != null)
return _pinMessafe;
}
set { _pinMessafe = value; }
}
No comments:
Post a Comment