From 5ab998fa4e240118f4e7c7545b56b1de212785ee Mon Sep 17 00:00:00 2001 From: Benjamin Bentmann Date: Sun, 17 Oct 2010 13:51:13 +0000 Subject: [PATCH] [MNG-4864] npe when transferring artifacts git-svn-id: https://svn.apache.org/repos/asf/maven/maven-3/trunk@1023501 13f79535-47bb-0310-9956-ffa450edef68 --- .../apache/maven/cli/ConsoleMavenTransferListener.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/maven-embedder/src/main/java/org/apache/maven/cli/ConsoleMavenTransferListener.java b/maven-embedder/src/main/java/org/apache/maven/cli/ConsoleMavenTransferListener.java index b0067105b0..6419e9e991 100644 --- a/maven-embedder/src/main/java/org/apache/maven/cli/ConsoleMavenTransferListener.java +++ b/maven-embedder/src/main/java/org/apache/maven/cli/ConsoleMavenTransferListener.java @@ -57,9 +57,12 @@ class ConsoleMavenTransferListener for ( Map.Entry entry : downloads.entrySet() ) { long total = entry.getKey().getContentLength(); - long complete = entry.getValue().longValue(); - - buffer.append( getStatus( complete, total ) ).append( " " ); + Long complete = entry.getValue(); + // NOTE: This null check guards against http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6312056 + if ( complete != null ) + { + buffer.append( getStatus( complete.longValue(), total ) ).append( " " ); + } } int pad = lastLength - buffer.length();