Commit 97829c77 authored by Pascal Palenda's avatar Pascal Palenda
Browse files

Fix crash due to empty source-receiver-pair - WIP

parent 99d62f8b
......@@ -176,16 +176,29 @@ namespace ITA
/// \param lhs the first object to check.
/// \param rhs the second object to check.
/// \return true if the given objects are exactly the same.
/// \todo Quick and dirty fix for empty source-receiver-pairs, should this be even possible? This has to be determined!
///
inline bool operator==( const CUpdateScene& lhs, const CUpdateScene& rhs )
{
const auto lhsSourceReceiverPair = lhs.getSourceReceiverPair ( );
const auto rhsSourceReceiverPair = rhs.getSourceReceiverPair ( );
return lhs.getID ( ) == rhs.getID ( ) &&
lhs.getReferenceID ( ) == rhs.getReferenceID ( ) &&
lhs.getTimeStamp ( ) == rhs.getTimeStamp ( ) &&
*lhsSourceReceiverPair.source == *rhsSourceReceiverPair.source &&
*lhsSourceReceiverPair.receiver == *rhsSourceReceiverPair.receiver;
if (lhsSourceReceiverPair.source && lhsSourceReceiverPair.receiver &&
rhsSourceReceiverPair.source && rhsSourceReceiverPair.receiver)
{
return lhs.getID ( ) == rhs.getID ( ) &&
lhs.getReferenceID ( ) == rhs.getReferenceID ( ) &&
lhs.getTimeStamp ( ) == rhs.getTimeStamp ( ) &&
*lhsSourceReceiverPair.source == *rhsSourceReceiverPair.source &&
*lhsSourceReceiverPair.receiver == *rhsSourceReceiverPair.receiver;
}
else
{
return lhs.getID ( ) == rhs.getID ( ) &&
lhs.getReferenceID ( ) == rhs.getReferenceID ( ) &&
lhs.getTimeStamp ( ) == rhs.getTimeStamp ( );
}
}
///
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment