mikehadlow/EasyNetQ — pull request #286 by letalumil (2014-10-07 18:14:06+00:00)
Title: Fix "NullReferenceException" when trying to get message from empty queue

When we are using BasicGet to retrieve message from queue we need to check if response is equal to null.
Code example from official [RabbitMQ API Guide](https://www.rabbitmq.com/api-guide.html):
```java
boolean autoAck = false;
GetResponse response = channel.basicGet(queueName, autoAck);
if (response == null) {
// No message retrieved.
} else {
AMQP.BasicProperties props = response.getProps();
byte[] body = response.getBody();
long deliveryTag = response.getEnvelope().getDeliveryTag();
...
```
So when queue is empty, response equals to null and that cause NullReferenceException:
```csharp
System.NullReferenceException : Object reference not set to an instance of an object.
at EasyNetQ.RabbitAdvancedBus.Get(IQueue queue) in RabbitAdvancedBus.cs: line 495
at EasyNetQ.RabbitAdvancedBus.Get(IQueue queue) in RabbitAdvancedBus.cs: line 465
at EasyNetQ.Tests.Integration.AdvancedApiExamples.Should_set_MessageAvailable_to_false_when_queue_is_empty() in AdvancedApiExamples.cs: line 144
```