You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by ro...@apache.org on 2019/06/12 14:27:25 UTC

[sling-whiteboard] 02/11: Prevent NPE if agent is launched with no arguments

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

rombert pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-whiteboard.git

commit 4fcc38d79c081bcbb42a2b3df4d04caf26e4acee
Author: Robert Munteanu <ro...@apache.org>
AuthorDate: Fri Jun 7 11:47:33 2019 +0200

    Prevent NPE if agent is launched with no arguments
---
 url-connection-agent/src/main/java/org/apache/sling/uca/impl/Agent.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/url-connection-agent/src/main/java/org/apache/sling/uca/impl/Agent.java b/url-connection-agent/src/main/java/org/apache/sling/uca/impl/Agent.java
index c35565f..a9320d6 100644
--- a/url-connection-agent/src/main/java/org/apache/sling/uca/impl/Agent.java
+++ b/url-connection-agent/src/main/java/org/apache/sling/uca/impl/Agent.java
@@ -25,7 +25,7 @@ public class Agent {
     public static void premain(String args, Instrumentation inst) {
         
         System.out.println("[AGENT] Loading agent...");
-        String[] parsedArgs = args.split(",");
+        String[] parsedArgs = args != null ? args.split(",") : new String[0];
         long connectTimeout =  TimeUnit.MINUTES.toMillis(1);
         long readTimeout = TimeUnit.MINUTES.toMillis(1);
         if ( parsedArgs.length > 0 )