summaryrefslogtreecommitdiffstats
path: root/src/main
diff options
context:
space:
mode:
authorwilliam <william.fromtw@gmail.com>2017-01-25 17:29:05 +0800
committerwilliam <william.fromtw@gmail.com>2017-01-25 17:29:05 +0800
commit06f23c3c476d02c5e7899ed5ada798bcafa7b4ff (patch)
treec713ed937d132109fd2caefcd7ffb8666f3f4157 /src/main
parent370487036c1d4037b9c54258eb0e8dbd4ab4036b (diff)
downloadgitblit-06f23c3c476d02c5e7899ed5ada798bcafa7b4ff.tar.gz
gitblit-06f23c3c476d02c5e7899ed5ada798bcafa7b4ff.zip
fix bug "get user default language null exception"
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/com/gitblit/authority/GitblitAuthority.java6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/main/java/com/gitblit/authority/GitblitAuthority.java b/src/main/java/com/gitblit/authority/GitblitAuthority.java
index 904042c9..15c23a79 100644
--- a/src/main/java/com/gitblit/authority/GitblitAuthority.java
+++ b/src/main/java/com/gitblit/authority/GitblitAuthority.java
@@ -48,6 +48,7 @@ import java.util.Collections;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
+import java.util.Locale;
import java.util.Map;
import java.util.ResourceBundle;
@@ -852,7 +853,10 @@ public class GitblitAuthority extends JFrame implements X509Log {
try {
if (mail.isReady()) {
Mailing mailing = Mailing.newPlain();
- mailing.subject = MessageFormat.format(ResourceBundle.getBundle("com.gitblit.wicket.GitBlitWebApp",user.getPreferences().getLocale()).getString("gb.emailClientCertificateSubject"), metadata.serverHostname);
+ if( user.getPreferences().getLocale()!=null )
+ mailing.subject = MessageFormat.format(ResourceBundle.getBundle("com.gitblit.wicket.GitBlitWebApp",user.getPreferences().getLocale()).getString("gb.emailClientCertificateSubject"), metadata.serverHostname);
+ else
+ mailing.subject = MessageFormat.format(ResourceBundle.getBundle("com.gitblit.wicket.GitBlitWebApp", Locale.ENGLISH).getString("gb.emailClientCertificateSubject") , metadata.serverHostname);
mailing.setRecipients(user.emailAddress);
File fileMailTmp = null;
String body = null;