diff --git a/src/iec61850/client/client_report_control.c b/src/iec61850/client/client_report_control.c index d1ba6ede..390863e4 100644 --- a/src/iec61850/client/client_report_control.c +++ b/src/iec61850/client/client_report_control.c @@ -201,7 +201,10 @@ ClientReportControlBlock_getConfRev(ClientReportControlBlock self) int ClientReportControlBlock_getOptFlds(ClientReportControlBlock self) { - return (MmsValue_getBitStringAsInteger(self->optFlds) / 2); + if (self->optFlds) + return (MmsValue_getBitStringAsInteger(self->optFlds) / 2); + else + return 0; } void diff --git a/src/iec61850/inc/iec61850_client.h b/src/iec61850/inc/iec61850_client.h index 19394ae5..bdc55a03 100644 --- a/src/iec61850/inc/iec61850_client.h +++ b/src/iec61850/inc/iec61850_client.h @@ -1582,6 +1582,7 @@ ClientReportControlBlock_getConfRev(ClientReportControlBlock self); * \brief Gets the OptFlds parameter of the RCB (decides what information to include in a report) * * \param self the RCB instance + * * \return bit field representing the optional fields of a report (uses flags from \ref REPORT_OPTIONS) */ LIB61850_API int