File tree Expand file tree Collapse file tree
src/main/java/de/samply/directory_sync_service Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1010 </parent >
1111 <groupId >de.samply</groupId >
1212 <artifactId >directory_sync_service</artifactId >
13- <version >1.5.11 </version >
13+ <version >1.5.12 </version >
1414 <name >directory_sync_service</name >
1515 <description >Directory sync</description >
1616 <url >https://github.com/samply/directory_sync_service</url >
Original file line number Diff line number Diff line change @@ -96,13 +96,26 @@ public boolean login() {
9696
9797 String endpoint = directoryEndpointsGraphql .getLoginEndpoint ();
9898 JsonObject result = directoryCallsGraphql .runGraphqlCommand (endpoint , graphqlCommand );
99-
10099 if (result == null ) {
101100 logger .warn ("login: result is null" );
102101 return false ;
103102 }
104103
105- String token = result .get ("signin" ).getAsJsonObject ().get ("token" ).getAsString ();
104+ JsonElement signin = result .get ("signin" );
105+ if (signin == null ) {
106+ logger .warn ("login: signin is null" );
107+ logger .warn ("login: result: " + Util .jsonStringFomObject (result ));
108+ return false ;
109+ }
110+
111+ JsonElement tokenObject = signin .getAsJsonObject ().get ("token" );
112+ if (tokenObject == null ) {
113+ logger .warn ("login: tokenObject is null" );
114+ logger .warn ("login: signin: " + Util .jsonStringFomObject (signin ));
115+ return false ;
116+ }
117+
118+ String token = tokenObject .getAsString ();
106119 if (token == null ) {
107120 logger .warn ("login: token is null" );
108121 return false ;
Original file line number Diff line number Diff line change @@ -382,7 +382,7 @@ public Patient extractPatientFromSpecimen(Specimen specimen) {
382382 .replaceFirst ("Patient/" , "" ))
383383 .execute ();
384384 } catch (Exception e ) {
385- logger .warn ("extractPatientFromSpecimen: caught exception" , Util .traceFromException (e ));
385+ logger .warn ("extractPatientFromSpecimen: caught exception: " + Util .traceFromException (e ));
386386 }
387387
388388 return patient ;
You can’t perform that action at this time.
0 commit comments