diff options
author | olivier lamy <olamy@apache.org> | 2017-05-10 21:35:53 +1000 |
---|---|---|
committer | olivier lamy <olamy@apache.org> | 2017-05-10 21:35:53 +1000 |
commit | 10b408249ea9d8e2d63054ba95714e3a628ca782 (patch) | |
tree | 12aa55a58d70ef0a0fe4c121365c960056205371 | |
parent | c2e13264a6bed75bb64d39424cd4f89a824164db (diff) | |
download | archiva-10b408249ea9d8e2d63054ba95714e3a628ca782.tar.gz archiva-10b408249ea9d8e2d63054ba95714e3a628ca782.zip |
avoid null
Signed-off-by: olivier lamy <olamy@apache.org>
-rw-r--r-- | archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/main.js | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/main.js b/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/main.js index 4085d4438..c047c2da8 100644 --- a/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/main.js +++ b/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/main.js @@ -861,17 +861,19 @@ function(jquery,ui,sammy,tmpl,i18n,jqueryCookie,bootstrap,archivaSearch,jqueryVa }; addValidationTokenHeader=function(user) { - if (user.validationToken) { - $.log("Adding validation token "+user.validationToken); - $.ajaxSetup({ - beforeSend: function (xhr) { - xhr.setRequestHeader('X-XSRF-TOKEN', user.validationToken); - } - }); - } else { - $.log("No validation token in user object "+user.username+", "+user.validationToken); + if(user) { + if (user.validationToken) { + $.log("Adding validation token "+user.validationToken); + $.ajaxSetup({ + beforeSend: function (xhr) { + xhr.setRequestHeader('X-XSRF-TOKEN', user.validationToken); + } + }); + } else { + $.log("No validation token in user object "+user.username+", "+user.validationToken); + } } - } + }; startArchivaApplication=function(){ |