From ece704f7dbba499463dab72ecf07a68ab84f6ce0 Mon Sep 17 00:00:00 2001 From: Benson Lim Date: Mon, 20 Feb 2012 10:42:57 +1100 Subject: [PATCH] if you delete a cloudQueueMessage with a different cloudQueue instance, PathUtility.appendPathToUri will throw NullPointerException because messageRequestAddress was not initialized by addMessage or retrieveMessage. --- .../windowsazure/services/queue/client/CloudQueue.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/queue/client/CloudQueue.java b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/queue/client/CloudQueue.java index 5e4ddf1ffdd7..38592ef9bb51 100644 --- a/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/queue/client/CloudQueue.java +++ b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/queue/client/CloudQueue.java @@ -830,6 +830,14 @@ public long getApproximateMessageCount() { * If the resource URI is invalid. */ URI getIndividualMessageAddress(final String messageId) throws URISyntaxException { + /* + if you delete a cloudQueueMessage with a different cloudQueue instance, + PathUtility.appendPathToUri will throw NullPointerException because + messageRequestAddress was not initialized by addMessage or retrieveMessage. + */ + if(this.messageRequestAddress == null) + this.getMessageRequestAddress(); + return PathUtility.appendPathToUri(this.messageRequestAddress, messageId); }