8159031: jjs throws NoSuchFileException if ~/.jjs.history does not exist
authorhannesw
Wed, 08 Jun 2016 15:50:11 +0200
changeset 38863 e031aa31b25f
parent 38862 983ae0be5c35
child 38864 bf2b41533aed
8159031: jjs throws NoSuchFileException if ~/.jjs.history does not exist Reviewed-by: sundar, mhaupt
jdk/src/jdk.internal.le/share/classes/jdk/internal/jline/extra/EditingHistory.java
--- a/jdk/src/jdk.internal.le/share/classes/jdk/internal/jline/extra/EditingHistory.java	Wed Jun 08 16:25:39 2016 +0800
+++ b/jdk/src/jdk.internal.le/share/classes/jdk/internal/jline/extra/EditingHistory.java	Wed Jun 08 15:50:11 2016 +0200
@@ -54,7 +54,9 @@
              (Runnable) () -> moveHistoryToSnippet(in, ((EditingHistory) in.getHistory())::previousSnippet));
         bind(in, CTRL_DOWN,
              (Runnable) () -> moveHistoryToSnippet(in, ((EditingHistory) in.getHistory())::nextSnippet));
-        load(originalHistory);
+        if (originalHistory != null) {
+            load(originalHistory);
+        }
     }
 
     private void moveHistoryToSnippet(ConsoleReader in, Supplier<Boolean> action) {