arcoirislabs / cordova-plugin-mqtt

MqTT Cordova Plugin for Apache Cordova (> v3.0)
MIT License
86 stars 49 forks source link

Cordova app crashed with wrong uri #19

Closed 4refr0nt closed 8 years ago

4refr0nt commented 8 years ago

App crashed if user use wrong uri (with space, for example)

arcoirislabs commented 8 years ago

Hi, We will add a regex for checking the url. Thanks for raising the issue.

4refr0nt commented 8 years ago

Thanks for fixing range checking! example for uri:

java.lang.IllegalArgumentException: tcp://m20.cloudmq tt.com:13191
    at org.eclipse.paho.client.mqttv3.MqttConnectOptions.validateURI(MqttConnectOptions.java:512)
    at org.eclipse.paho.client.mqttv3.MqttAsyncClient.<init>(MqttAsyncClient.java:291)
    at org.eclipse.paho.client.mqttv3.MqttAsyncClient.<init>(MqttAsyncClient.java:185)
    at com.arcoirislabs.plugin.mqtt.CordovaMqTTPlugin.connect(CordovaMqTTPlugin.java:125)
    at com.arcoirislabs.plugin.mqtt.CordovaMqTTPlugin.access$000(CordovaMqTTPlugin.java:24)
    at com.arcoirislabs.plugin.mqtt.CordovaMqTTPlugin$1.run(CordovaMqTTPlugin.java:42)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
    at java.lang.Thread.run(Thread.java:818)
arcoirislabs commented 8 years ago

@4refr0nt Thank you for the example

arcoirislabs commented 8 years ago

The issue is addressed