Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id B1AD5200B5A for ; Wed, 20 Jul 2016 13:08:07 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id B0659160A64; Wed, 20 Jul 2016 11:08:07 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 0ED63160A73 for ; Wed, 20 Jul 2016 13:08:06 +0200 (CEST) Received: (qmail 5614 invoked by uid 500); 20 Jul 2016 11:08:06 -0000 Mailing-List: contact commits-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cxf.apache.org Delivered-To: mailing list commits@cxf.apache.org Received: (qmail 5598 invoked by uid 99); 20 Jul 2016 11:08:06 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 20 Jul 2016 11:08:06 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 1FEC1E08E8; Wed, 20 Jul 2016 11:08:06 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: coheigea@apache.org To: commits@cxf.apache.org Date: Wed, 20 Jul 2016 11:08:07 -0000 Message-Id: In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [2/2] cxf-fediz git commit: Fixing NPE if no key alias archived-at: Wed, 20 Jul 2016 11:08:07 -0000 Fixing NPE if no key alias Project: http://git-wip-us.apache.org/repos/asf/cxf-fediz/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf-fediz/commit/c7ee8a22 Tree: http://git-wip-us.apache.org/repos/asf/cxf-fediz/tree/c7ee8a22 Diff: http://git-wip-us.apache.org/repos/asf/cxf-fediz/diff/c7ee8a22 Branch: refs/heads/1.2.x-fixes Commit: c7ee8a223f1e4a40cac1a1b20b1cca2adeeb240b Parents: f00f2b3 Author: Colm O hEigeartaigh Authored: Wed Jul 20 11:56:13 2016 +0100 Committer: Colm O hEigeartaigh Committed: Wed Jul 20 11:59:42 2016 +0100 ---------------------------------------------------------------------- .../src/main/java/org/apache/cxf/fediz/core/util/CertsUtils.java | 4 ++++ 1 file changed, 4 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/c7ee8a22/plugins/core/src/main/java/org/apache/cxf/fediz/core/util/CertsUtils.java ---------------------------------------------------------------------- diff --git a/plugins/core/src/main/java/org/apache/cxf/fediz/core/util/CertsUtils.java b/plugins/core/src/main/java/org/apache/cxf/fediz/core/util/CertsUtils.java index 0d3981f..c6f9c25 100644 --- a/plugins/core/src/main/java/org/apache/cxf/fediz/core/util/CertsUtils.java +++ b/plugins/core/src/main/java/org/apache/cxf/fediz/core/util/CertsUtils.java @@ -110,6 +110,10 @@ public final class CertsUtils { if (keyAlias == null || "".equals(keyAlias)) { keyAlias = crypto.getDefaultX509Identifier(); } + + if (keyAlias == null) { + throw new RuntimeException("No keystore alias was specified to sign the metadata"); + } CryptoType cryptoType = new CryptoType(CryptoType.TYPE.ALIAS); cryptoType.setAlias(keyAlias);