eclipse / paho.mqtt.java

Eclipse Paho Java MQTT client library. Paho is an Eclipse IoT project.
https://eclipse.org/paho
Other
2.12k stars 883 forks source link

MqttProperties.setResponseTopic() cannot accept null #550

Closed dennynguyen closed 6 years ago

dennynguyen commented 6 years ago

Please fill out the form below before submitting, thank you!

If this is a bug regarding the Android Service, please raise the bug here instead: https://github.com/eclipse/paho.mqtt.android/issues/new

When passing null to MqttProperties.setResponseTopic, it throws null pointer exception.

It should be acceptable to set the property to null.

java.lang.NullPointerException
java.lang.NullPointerException
  at org.eclipse.paho.mqttv5.common.util.MqttTopicValidator.validate(MqttTopicValidator.java:55)
  at org.eclipse.paho.mqttv5.common.packet.MqttProperties.setResponseTopic(MqttProperties.java:1229)
  at com.ibm.ism.ws.test.MyMessage.setResponseTopic(MyMessage.java:816)
  at com.ibm.ism.ws.test.CreateMessageAction.invokeApi(CreateMessageAction.java:159)
  at com.ibm.ism.ws.test.ApiCallAction.run(ApiCallAction.java:159)
  at com.ibm.ism.ws.test.Action.execute(Action.java:256)
  at com.ibm.ism.ws.test.CompositeAction$CompositeActionRunable.run(CompositeAction.java:189)
  at java.lang.Thread.run(Thread.java:745)
jpwsutton commented 6 years ago

Thanks for raising this @dennynguyen, this has now been resolved in commit efdba4a98947a7fa7fb76b5b17e8dc69f5491f87