X-Git-Url: http://git.argeo.org/?a=blobdiff_plain;f=server%2Fruntime%2Forg.argeo.server.jcr%2Fsrc%2Fmain%2Fjava%2Forg%2Fargeo%2Fjcr%2FJcrUtils.java;h=1cecd7100611744524da8e08296dbc49f00b935a;hb=e890c9d9d57069b464b406405797f38e7263f3b1;hp=c7915d0ed57bb89ed132419247c3eebc18037ff7;hpb=ca91d6c3f261173feb0ae4914450a119336f83c1;p=lgpl%2Fargeo-commons.git diff --git a/server/runtime/org.argeo.server.jcr/src/main/java/org/argeo/jcr/JcrUtils.java b/server/runtime/org.argeo.server.jcr/src/main/java/org/argeo/jcr/JcrUtils.java index c7915d0ed..1cecd7100 100644 --- a/server/runtime/org.argeo.server.jcr/src/main/java/org/argeo/jcr/JcrUtils.java +++ b/server/runtime/org.argeo.server.jcr/src/main/java/org/argeo/jcr/JcrUtils.java @@ -167,7 +167,7 @@ public class JcrUtils implements ArgeoJcrConstants { buf.append('Y'); buf.append(cal.get(Calendar.YEAR)); buf.append('/'); - + int month = cal.get(Calendar.MONTH) + 1; buf.append('M'); if (month < 10) @@ -746,8 +746,13 @@ public class JcrUtils implements ArgeoJcrConstants { /** Logs out the session, not throwing any exception, even if it is null. */ public static void logoutQuietly(Session session) { - if (session != null) - session.logout(); + try { + if (session != null) + if (session.isLive()) + session.logout(); + } catch (Exception e) { + // silent + } } /** Returns the home node of the session user or null if none was found. */