[java-idp-plugin-duo] branch dev/JDUO-82 updated: Fix possible null User return object

Phil Smart philip.smart at jisc.ac.uk
Fri Jan 5 16:43:44 UTC 2024


This is an automated email from the git hooks/post-receive script.

philsmart pushed a commit to branch dev/JDUO-82
in repository java-idp-plugin-duo.

View the commit online:
http://git.shibboleth.net/view/?p=java-idp-plugin-duo.git;a=commit;h=534b1e069d5e1f45343714aa69751a075435217a

The following commit(s) were added to refs/heads/dev/JDUO-82 by this push:
     new 534b1e06 Fix possible null User return object
534b1e06 is described below

commit 534b1e069d5e1f45343714aa69751a075435217a
Author: Phil Smart <philip.smart at jisc.ac.uk>
AuthorDate: Fri Jan 5 16:43:41 2024 +0000

    Fix possible null User return object
---
 .../shibboleth/idp/plugin/authn/duo/impl/DefaultDuoAdminClient.java | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/idp-duo-impl/src/main/java/net/shibboleth/idp/plugin/authn/duo/impl/DefaultDuoAdminClient.java b/idp-duo-impl/src/main/java/net/shibboleth/idp/plugin/authn/duo/impl/DefaultDuoAdminClient.java
index 315bcf52..e5fc6dfd 100644
--- a/idp-duo-impl/src/main/java/net/shibboleth/idp/plugin/authn/duo/impl/DefaultDuoAdminClient.java
+++ b/idp-duo-impl/src/main/java/net/shibboleth/idp/plugin/authn/duo/impl/DefaultDuoAdminClient.java
@@ -172,7 +172,11 @@ public class DefaultDuoAdminClient extends AbstractIdentifiableInitializableComp
             if (response.size() != 1) {
                 throw new DuoException("User API response did not contain a single user");
             }
-            return response.get(0);
+            final User user = response.get(0);
+            if (user == null) {
+                throw new DuoException("User API response did not contain a single user"); 
+            }
+            return user;
 
         } catch (final Exception ex) {
             throw new DuoException("Unable to to get User '"+username+"' from Duo's Admin API", ex);

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the commits mailing list