protected User safeGetSender(MessageEnvelope envelope) {
		if (envelope != null && envelope.getSender() != null
				&& envelope.getSender().getId() != null) {
			return envelope.getSender();
		}
		return new User();
	}
protected User safeGetSender ( MessageEnvelope envelope ) { if ( envelope != null && envelope . getSender ( ) != null && envelope . getSender ( ) . getId ( ) != null ) { return envelope . getSender ( ) ; } return new User ( ) ; }
Retrieves the sender from an envelope. It never returns null.

@param envelope
the message envelope.
@return a {@link User} containing the sender if found, empty otherwise.
It never returns null.