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/1dcfe275 Tree: http://git-wip-us.apache.org/repos/asf/karaf/tree/1dcfe275 Diff: http://git-wip-us.apache.org/repos/asf/karaf/diff/1dcfe275 Branch: refs/heads/karaf-3.0.x Commit: 1dcfe2752ce35c2f6e0980dd7d4f4eb4e937cc3b Parents: 21ee54c Author: Jonathan Anstey <jans...@gmail.com> Authored: Thu Apr 10 14:15:01 2014 -0230 Committer: Jonathan Anstey <jans...@gmail.com> Committed: Thu Apr 10 14:15:01 2014 -0230 ---------------------------------------------------------------------- .../java/org/apache/karaf/features/command/RepoListCommand.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/karaf/blob/1dcfe275/features/command/src/main/java/org/apache/karaf/features/command/RepoListCommand.java ---------------------------------------------------------------------- diff --git a/features/command/src/main/java/org/apache/karaf/features/command/RepoListCommand.java b/features/command/src/main/java/org/apache/karaf/features/command/RepoListCommand.java index 0cf4b97..939b490 100644 --- a/features/command/src/main/java/org/apache/karaf/features/command/RepoListCommand.java +++ b/features/command/src/main/java/org/apache/karaf/features/command/RepoListCommand.java @@ -47,7 +47,9 @@ public class RepoListCommand extends FeaturesCommandSupport { Repository[] repos = featuresService.listRepositories(); for (Repository repo : repos) { - table.addRow().addContent(repo.getName(), repo.getURI().toString()); + if (repo != null) { + table.addRow().addContent(repo.getName(), repo.getURI().toString()); + } } table.print(System.out, !noFormat); }