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

sijie pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-pulsar.git


The following commit(s) were added to refs/heads/master by this push:
     new 46f3829  Fix NPE in Pulsar Functions CLI  (#1776)
46f3829 is described below

commit 46f3829b1fce7a633ea41834760c42ad754af8ce
Author: Luc Perkins <lucperk...@gmail.com>
AuthorDate: Tue May 15 11:21:14 2018 -0700

    Fix NPE in Pulsar Functions CLI  (#1776)
    
    As it stands, an NPE is thrown if you try to `create` or `localrun` a 
function with neither a class name nor a function name supplied, as the CLI 
will attempt to infer a function name from a class name that is `null`.
---
 .../src/main/java/org/apache/pulsar/admin/cli/CmdFunctions.java       | 4 ++++
 1 file changed, 4 insertions(+)

diff --git 
a/pulsar-client-tools/src/main/java/org/apache/pulsar/admin/cli/CmdFunctions.java
 
b/pulsar-client-tools/src/main/java/org/apache/pulsar/admin/cli/CmdFunctions.java
index b704ec7..65a1db2 100644
--- 
a/pulsar-client-tools/src/main/java/org/apache/pulsar/admin/cli/CmdFunctions.java
+++ 
b/pulsar-client-tools/src/main/java/org/apache/pulsar/admin/cli/CmdFunctions.java
@@ -582,6 +582,10 @@ public class CmdFunctions extends CmdBase {
         }
 
         private void inferMissingFunctionName(FunctionConfig functionConfig) {
+            if (isNull(functionConfig.getClassName())) {
+                throw new IllegalArgumentException("You must specify a class 
name for the function");
+            }
+
             String [] domains = functionConfig.getClassName().split("\\.");
             if (domains.length == 0) {
                 functionConfig.setName(functionConfig.getClassName());

-- 
To stop receiving notification emails like this one, please contact
si...@apache.org.

Reply via email to