From a69fafc4ddbfa1c44e9241e0650bfdd2405796bf Mon Sep 17 00:00:00 2001 From: Steven Luo Date: Wed, 29 Jun 2011 01:18:39 -0700 Subject: [PATCH] PircBot: Gracefully handle disposing of the PircBot before I/O threads are started --- application/src/org/jibble/pircbot/PircBot.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/application/src/org/jibble/pircbot/PircBot.java b/application/src/org/jibble/pircbot/PircBot.java index eb9cd97..2f355ff 100644 --- a/application/src/org/jibble/pircbot/PircBot.java +++ b/application/src/org/jibble/pircbot/PircBot.java @@ -2983,8 +2983,12 @@ public abstract class PircBot implements ReplyConstants { */ public synchronized void dispose() { //System.out.println("disposing..."); - _outputThread.interrupt(); - _inputThread.dispose(); + if (_outputThread != null) { + _outputThread.interrupt(); + } + if (_inputThread != null) { + _inputThread.dispose(); + } }