mirror of
https://github.com/apache/activemq.git
synced 2025-02-17 07:24:51 +00:00
fix for npe
git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@584929 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
1722001748
commit
fe9bd4f594
@ -379,14 +379,17 @@ public class AMQMessageStore implements MessageStore {
|
||||
*/
|
||||
public Message getMessage(MessageId identity) throws IOException {
|
||||
Location location = getLocation(identity);
|
||||
DataStructure rc = peristenceAdapter.readCommand(location);
|
||||
try {
|
||||
return (Message) rc;
|
||||
} catch (ClassCastException e) {
|
||||
throw new IOException("Could not read message " + identity
|
||||
+ " at location " + location
|
||||
+ ", expected a message, but got: " + rc);
|
||||
if (location != null) {
|
||||
DataStructure rc = peristenceAdapter.readCommand(location);
|
||||
try {
|
||||
return (Message) rc;
|
||||
} catch (ClassCastException e) {
|
||||
throw new IOException("Could not read message " + identity
|
||||
+ " at location " + location
|
||||
+ ", expected a message, but got: " + rc);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
protected Location getLocation(MessageId messageId) throws IOException {
|
||||
|
Loading…
x
Reference in New Issue
Block a user