Skip to content

Commit

Permalink
[FIX] ShellResultListener reference
Browse files Browse the repository at this point in the history
  • Loading branch information
manneohlund committed Oct 2, 2017
1 parent 32d0c26 commit 6ad683b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions library/src/main/java/ashell/workers/ShellReader.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ public void run() {
String line = "";
try {
while ((line = reader.readLine()) != null) {
if (onShellResultListener != null && line != null && line.length() != 0) {
if (getOnShellResultListener() != null && line.length() != 0) {
//Log.e(this.getName(), "READER: " + line); // TODO: 03/04/17 Remove this?
if (!onShellResultListener.onShellResult(line)) {
if (!getOnShellResultListener().onShellResult(line)) {
//Log.e(this.getName(), "READER: " + line); // TODO: 03/04/17 Remove this?
if (line.equals(CMD_DONE)) {
setBusy(false);
Expand All @@ -57,8 +57,8 @@ public void run() {
e.printStackTrace();
}
}
if (notErrorListener && onShellResultListener != null) {
onShellResultListener.onShellResult("SHELL_EXIT");
if (notErrorListener && getOnShellResultListener() != null) {
getOnShellResultListener().onShellResult("SHELL_EXIT");
onShellStateListener.onShellStateChanged(OnShellStateListener.State.TERMINATED);
}
}
Expand Down

0 comments on commit 6ad683b

Please sign in to comment.