You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@isis.apache.org by da...@apache.org on 2018/01/24 15:16:49 UTC

[isis] 13/20: ISIS-1836: removes chance of an NPE in the RO mapper for an exception (which was in turn resulting in a 500 rather than 422 when invoked an action with an incorrect parameter argument).

This is an automated email from the ASF dual-hosted git repository.

danhaywood pushed a commit to branch ISIS-1569-replay-commands
in repository https://gitbox.apache.org/repos/asf/isis.git

commit 8463f4b55c64f847bfd9a1da5a8b5eeb3dc3def1
Author: Dan Haywood <da...@haywood-associates.co.uk>
AuthorDate: Fri Jan 19 14:22:43 2018 +0000

    ISIS-1836: removes chance of an NPE in the RO mapper for an exception (which was in turn resulting in a 500 rather than 422 when invoked an action with an incorrect parameter argument).
---
 .../viewer/restfulobjects/server/mappers/entity/ExceptionDetail.java    | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/core/viewer-restfulobjects-server/src/main/java/org/apache/isis/viewer/restfulobjects/server/mappers/entity/ExceptionDetail.java b/core/viewer-restfulobjects-server/src/main/java/org/apache/isis/viewer/restfulobjects/server/mappers/entity/ExceptionDetail.java
index d47e2a3..862c2d8 100644
--- a/core/viewer-restfulobjects-server/src/main/java/org/apache/isis/viewer/restfulobjects/server/mappers/entity/ExceptionDetail.java
+++ b/core/viewer-restfulobjects-server/src/main/java/org/apache/isis/viewer/restfulobjects/server/mappers/entity/ExceptionDetail.java
@@ -77,7 +77,7 @@ public class ExceptionDetail {
         if (ex instanceof JDOException) {
             final JDOException jdoException = (JDOException) ex;
             final Throwable[] nestedExceptions = jdoException.getNestedExceptions();
-            return nestedExceptions.length > 0? nestedExceptions[0]: null;
+            return nestedExceptions != null && nestedExceptions.length > 0? nestedExceptions[0]: null;
         }
         else {
             return ex.getCause();

-- 
To stop receiving notification emails like this one, please contact
danhaywood@apache.org.