You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@karaf.apache.org by jb...@apache.org on 2018/09/11 19:10:56 UTC

[karaf] branch karaf-4.1.x updated: [KARAF-5887] Fix NPE on ConsoleSessionImpl (#602)

This is an automated email from the ASF dual-hosted git repository.

jbonofre pushed a commit to branch karaf-4.1.x
in repository https://gitbox.apache.org/repos/asf/karaf.git


The following commit(s) were added to refs/heads/karaf-4.1.x by this push:
     new 5aa8286  [KARAF-5887] Fix NPE on ConsoleSessionImpl (#602)
5aa8286 is described below

commit 5aa828649b3b4961ed93ce87944bddcc236cefa3
Author: Ottaviani Nicolas <ni...@gmail.com>
AuthorDate: Tue Sep 11 21:10:54 2018 +0200

    [KARAF-5887] Fix NPE on ConsoleSessionImpl (#602)
    
    [KARAF-5887] Fix NPE on ConsoleSessionImpl
---
 .../apache/karaf/shell/impl/console/ConsoleSessionImpl.java    | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/shell/core/src/main/java/org/apache/karaf/shell/impl/console/ConsoleSessionImpl.java b/shell/core/src/main/java/org/apache/karaf/shell/impl/console/ConsoleSessionImpl.java
index 662cd50..edbfb5b 100644
--- a/shell/core/src/main/java/org/apache/karaf/shell/impl/console/ConsoleSessionImpl.java
+++ b/shell/core/src/main/java/org/apache/karaf/shell/impl/console/ConsoleSessionImpl.java
@@ -135,7 +135,15 @@ public class ConsoleSessionImpl implements Session {
         }
 
         // Create session
-        session = processor.createSession(in, out, err);
+        if (in == null || out == null || err == null) {
+            session = processor.createSession(
+                jlineTerminal.input(),
+                jlineTerminal.output(),
+                jlineTerminal.output());
+        }
+        else {
+            session = processor.createSession(in, out, err);
+        }
 
         // Completers
         Completers.CompletionEnvironment env = new Completers.CompletionEnvironment() {