Repository: karaf Updated Branches: refs/heads/karaf-2.3.x 0c4370f4f -> c6cb968c2 refs/heads/karaf-2.x f85b11f5e -> fdababb92 refs/heads/karaf-3.0.x 21ee54c56 -> 1dcfe2752 refs/heads/master 48ef3aa01 -> 4b6b7afb1
KARAF-2899 - NPE when running features:listUrl Project: http://git-wip-us.apache.org/repos/asf/karaf/repo Commit: http://git-wip-us.apache.org/repos/asf/karaf/commit/fdababb9 Tree: http://git-wip-us.apache.org/repos/asf/karaf/tree/fdababb9 Diff: http://git-wip-us.apache.org/repos/asf/karaf/diff/fdababb9 Branch: refs/heads/karaf-2.x Commit: fdababb923d7f3747dac9015f58080bf20fcc44e Parents: f85b11f Author: Jonathan Anstey <jans...@gmail.com> Authored: Thu Apr 10 13:58:25 2014 -0230 Committer: Jonathan Anstey <jans...@gmail.com> Committed: Thu Apr 10 13:58:25 2014 -0230 ---------------------------------------------------------------------- .../karaf/features/command/ListUrlCommand.java | 28 +++++++++++--------- 1 file changed, 15 insertions(+), 13 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/karaf/blob/fdababb9/features/command/src/main/java/org/apache/karaf/features/command/ListUrlCommand.java ---------------------------------------------------------------------- diff --git a/features/command/src/main/java/org/apache/karaf/features/command/ListUrlCommand.java b/features/command/src/main/java/org/apache/karaf/features/command/ListUrlCommand.java index 206a849..26d51f5 100644 --- a/features/command/src/main/java/org/apache/karaf/features/command/ListUrlCommand.java +++ b/features/command/src/main/java/org/apache/karaf/features/command/ListUrlCommand.java @@ -52,23 +52,25 @@ public class ListUrlCommand extends FeaturesCommandSupport { if ((repos != null) && (repos.length > 0)) { for (int i = 0; i < repos.length; i++) { - URI uri = repos[i].getURI(); + if (repos[i] != null) { + URI uri = repos[i].getURI(); - String line = ""; - line += repos[i].isValid() ? " true " : " false"; + String line = ""; + line += repos[i].isValid() ? " true " : " false"; - if (validation) { - try { - admin.validateRepository(uri); - // append valid flag if validation mode is tuned on - line += " true "; - } catch (Exception e) { - line += " false "; - verboseOutput += uri + ":" + e.getMessage() + "\n"; + if (validation) { + try { + admin.validateRepository(uri); + // append valid flag if validation mode is tuned on + line += " true "; + } catch (Exception e) { + line += " false "; + verboseOutput += uri + ":" + e.getMessage() + "\n"; + } } - } - System.out.println(line + " " + uri); + System.out.println(line + " " + uri); + } } if (verbose) {