From d8f409fad6bb8a27070ae0afe5d2e27a2f694d6c Mon Sep 17 00:00:00 2001 From: gmantele <gmantele@ari.uni-heidelberg.de> Date: Tue, 2 Jun 2015 17:40:39 +0200 Subject: [PATCH] [TAP] Fix NullPointerException in TAPConfiguration (this error happens only when a NoSuchMethodException occurs. --- src/tap/config/TAPConfiguration.java | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/tap/config/TAPConfiguration.java b/src/tap/config/TAPConfiguration.java index 11934ed..1794a44 100644 --- a/src/tap/config/TAPConfiguration.java +++ b/src/tap/config/TAPConfiguration.java @@ -36,7 +36,7 @@ import tap.backup.DefaultTAPBackupManager; * and it must be used only thanks to its static classes and attributes.</i></p> * * @author Grégory Mantelet (ARI) - * @version 2.0 (04/2015) + * @version 2.1 (06/2015) * @since 2.0 */ public final class TAPConfiguration { @@ -416,12 +416,14 @@ public final class TAPConfiguration { }catch(NoSuchMethodException e){ // List parameters' type: StringBuffer pTypesStr = new StringBuffer(); - for(int i = 0; i < pTypes.length; i++){ - if (pTypesStr.length() > 0) - pTypesStr.append(", "); - if (pTypes[i] == null) - pTypesStr.append("NULL"); - pTypesStr.append(pTypes[i].getName()); + if (pTypes != null){ + for(int i = 0; i < pTypes.length; i++){ + if (pTypesStr.length() > 0) + pTypesStr.append(", "); + if (pTypes[i] == null) + pTypesStr.append("NULL"); + pTypesStr.append(pTypes[i].getName()); + } } // Throw the error: throw new TAPException("Missing constructor " + classObj.getName() + "(" + pTypesStr.toString() + ")! See the value \"" + propValue + "\" of the property \"" + propName + "\"."); -- GitLab