Skip to content

Commit

Permalink
Fixed potential NPE on shutdown in case the stream endpoint uri is in…
Browse files Browse the repository at this point in the history
…valid.

git-svn-id: https://svn.apache.org/repos/asf/camel/trunk@794696 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
davsclaus committed Jul 16, 2009
1 parent dc8cb21 commit c46e450
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
Expand Down Expand Up @@ -82,9 +81,10 @@ protected void doStart() throws Exception {
public void doStop() throws Exception {
// important: do not close the stream as it will close the standard
// system.in etc.
ObjectHelper.notNull(executor, "Executor");
executor.shutdownNow();
executor = null;
if (executor != null) {
executor.shutdownNow();
executor = null;
}
super.doStop();
}

Expand Down

0 comments on commit c46e450

Please sign in to comment.