From: Lars Op den Kamp Date: Fri, 13 Dec 2013 10:22:46 +0000 (+0100) Subject: don't crash LibCecSharp when receiving an alert with a NULL param (like the connectio... X-Git-Tag: upstream/2.2.0~1^2~3^2~10 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=423803df43757dc745b5de829c432b7342632147;p=deb_libcec.git don't crash LibCecSharp when receiving an alert with a NULL param (like the connection lost alert) --- diff --git a/src/LibCecSharp/CecSharpTypes.h b/src/LibCecSharp/CecSharpTypes.h index 6dc324a..78d01a9 100644 --- a/src/LibCecSharp/CecSharpTypes.h +++ b/src/LibCecSharp/CecSharpTypes.h @@ -2405,7 +2405,7 @@ namespace CecSharp CecParameterType newType = (CecParameterType)data.paramType; if (newType == CecParameterType::ParameterTypeString) { - System::String ^ newData = gcnew System::String((const char *)data.paramData, 0, 128); + System::String ^ newData = gcnew System::String(data.paramData ? (const char *)data.paramData : "", 0, 128); CecParameter ^ newParam = gcnew CecParameter(newType, newData); iReturn = m_callbacks->ReceiveAlert((CecAlert)alert, newParam); }