Browse Source

HDDS-482. NullPointer exception thrown on console when cli operation failed.
Contributed by Nandakumar.

Anu Engineer 6 năm trước cách đây
mục cha
commit
0cb3316cec

+ 1 - 1
hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/cli/GenericCli.java

@@ -51,7 +51,7 @@ public class GenericCli implements Callable<Void>, GenericParentCommand {
     try {
       execute(argv);
     } catch (ExecutionException ex) {
-      printError(ex.getCause());
+      printError(ex.getCause() == null ? ex : ex.getCause());
       System.exit(-1);
     }
   }