ZUGFERDRESTService: Ggf. DBNull-Returnwerte abfangen
This commit is contained in:
@@ -666,7 +666,13 @@ namespace ZUGFeRDRESTService.Controllers
|
|||||||
|
|
||||||
if (_database.MSSQL.ExecuteNonQuery(oCommand))
|
if (_database.MSSQL.ExecuteNonQuery(oCommand))
|
||||||
{
|
{
|
||||||
string oReturnValue = (string)oCommand.Parameters["@MSG_OUTPUT"].Value;
|
string oReturnValue = string.Empty;
|
||||||
|
|
||||||
|
if (oCommand.Parameters["@MSG_OUTPUT"] != null && oCommand.Parameters["@MSG_OUTPUT"].Value != null)
|
||||||
|
{
|
||||||
|
object val = oCommand.Parameters["@MSG_OUTPUT"].Value;
|
||||||
|
oReturnValue = (val == null || val is DBNull) ? string.Empty : (string)val;
|
||||||
|
}
|
||||||
|
|
||||||
_logger.Debug("Validation Result message from DB: " + oReturnValue);
|
_logger.Debug("Validation Result message from DB: " + oReturnValue);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user