@@ -66,7 +66,11 @@ public class SecurityUtils
{
try
- return (LoginUser) getAuthentication().getPrincipal();
+ Object res = getAuthentication().getPrincipal();
+ if (res instanceof LoginUser) {
+ return (LoginUser) res;
+ }
+ return null;
}
catch (Exception e)