|
@@ -176,8 +176,13 @@ public class Twitter implements Parser, TwitterErrorHandler, TwitterRawHandler,
|
176
|
176
|
* @param myPlugin Plugin that created this parser
|
177
|
177
|
*/
|
178
|
178
|
protected Twitter(final MyInfo myInfo, final URI address, final TwitterPlugin myPlugin) {
|
179
|
|
- final String[] bits = address.getUserInfo().split(":");
|
180
|
|
- this.myUsername = bits[0];
|
|
179
|
+ final String[] bits;
|
|
180
|
+ if (address.getUserInfo() == null) {
|
|
181
|
+ bits = new String[]{};
|
|
182
|
+ } else {
|
|
183
|
+ bits = address.getUserInfo().split(":");
|
|
184
|
+ }
|
|
185
|
+ this.myUsername = bits.length == 0 ? "" : bits[0];
|
181
|
186
|
this.myPassword = (bits.length > 1) ? bits[1] : "";
|
182
|
187
|
|
183
|
188
|
this.myPlugin = myPlugin;
|
|
@@ -872,6 +877,12 @@ public class Twitter implements Parser, TwitterErrorHandler, TwitterRawHandler,
|
872
|
877
|
public void run() {
|
873
|
878
|
resetState();
|
874
|
879
|
|
|
880
|
+ if (myUsername.isEmpty()) {
|
|
881
|
+ sendPrivateNotice("Unable to connect to "+myServerName+" without a username. Disconnecting.");
|
|
882
|
+ getCallbackManager().getCallbackType(SocketCloseListener.class).call();
|
|
883
|
+ return;
|
|
884
|
+ }
|
|
885
|
+
|
875
|
886
|
// Get the consumerKey and consumerSecret for this server if known
|
876
|
887
|
// else default to our twitter key and secret
|
877
|
888
|
final String consumerKey;
|