- (dissemination_message_t*) call AMSend.getPayload( &m_buf );
-
- m_bufBusy = TRUE;
-
- dMsg->key = key;
- dMsg->seqno = call DisseminationCache.requestSeqno[ key ]();
-
- if ( dMsg->seqno != DISSEMINATION_SEQNO_UNKNOWN ) {
- object = call DisseminationCache.requestData[ key ]( &objectSize );
- if ((objectSize + sizeof(dissemination_message_t)) >
- call AMSend.maxPayloadLength()) {
- objectSize = call AMSend.maxPayloadLength() - sizeof(dissemination_message_t);
- }
- memcpy( dMsg->data, object, objectSize );
- }
- call AMSend.send( AM_BROADCAST_ADDR,
- &m_buf, sizeof( dissemination_message_t ) + objectSize );
+ (dissemination_message_t*) call AMSend.getPayload( &m_buf, sizeof(dissemination_message_t) );
+ if (dMsg != NULL) {
+ m_bufBusy = TRUE;
+
+ dMsg->key = key;
+ dMsg->seqno = call DisseminationCache.requestSeqno[ key ]();
+
+ if ( dMsg->seqno != DISSEMINATION_SEQNO_UNKNOWN ) {
+ object = call DisseminationCache.requestData[ key ]( &objectSize );
+ if ((objectSize + sizeof(dissemination_message_t)) >
+ call AMSend.maxPayloadLength()) {
+ objectSize = call AMSend.maxPayloadLength() - sizeof(dissemination_message_t);
+ }
+ memcpy( dMsg->data, object, objectSize );
+ }
+ call AMSend.send( AM_BROADCAST_ADDR,
+ &m_buf, sizeof( dissemination_message_t ) + objectSize );
+ }