JMS - watch out from null Message property enumeration
@@ -244,6 +244,7 @@ public class JmsInstrumentationHelperImpl implements JmsInstrumentationHelper<De
messageContext.addHeader(JMS_TIMESTAMP_HEADER, String.valueOf(message.getJMSTimestamp()));
Enumeration properties = message.getPropertyNames();
+ if (properties != null) {
while (properties.hasMoreElements()) {
String propertyName = String.valueOf(properties.nextElement());
if (!propertyName.equals(JMS_DESTINATION_NAME_PROPERTY) && !propertyName.equals(JMS_TRACE_PARENT_PROPERTY)
@@ -252,6 +253,7 @@ public class JmsInstrumentationHelperImpl implements JmsInstrumentationHelper<De
}
}
}
+ }
} catch (JMSException e) {
logger.warn("Failed to retrieve message details", e);
}
