Commit d340702ba3396c72883253cb2da30bf3dd6a8fff
1 parent
87e8a79a
Exists in
master
Ajuste no produtor de Locale
Showing
1 changed file
with
9 additions
and
1 deletions
Show diff stats
impl/extension/servlet/src/main/java/br/gov/frameworkdemoiselle/internal/producer/ServletLocaleProducer.java
@@ -51,6 +51,14 @@ public class ServletLocaleProducer { | @@ -51,6 +51,14 @@ public class ServletLocaleProducer { | ||
51 | @Produces | 51 | @Produces |
52 | @Default | 52 | @Default |
53 | public Locale create() { | 53 | public Locale create() { |
54 | - return request.getLocale(); | 54 | + Locale result; |
55 | + | ||
56 | + if (request == null) { | ||
57 | + result = Locale.getDefault(); | ||
58 | + } else { | ||
59 | + result = request.getLocale(); | ||
60 | + } | ||
61 | + | ||
62 | + return result; | ||
55 | } | 63 | } |
56 | } | 64 | } |