diff --git a/impl/extension/servlet/src/main/java/br/gov/frameworkdemoiselle/internal/producer/ServletLocaleProducer.java b/impl/extension/servlet/src/main/java/br/gov/frameworkdemoiselle/internal/producer/ServletLocaleProducer.java index 0707531..590ae80 100644 --- a/impl/extension/servlet/src/main/java/br/gov/frameworkdemoiselle/internal/producer/ServletLocaleProducer.java +++ b/impl/extension/servlet/src/main/java/br/gov/frameworkdemoiselle/internal/producer/ServletLocaleProducer.java @@ -51,6 +51,14 @@ public class ServletLocaleProducer { @Produces @Default public Locale create() { - return request.getLocale(); + Locale result; + + if (request == null) { + result = Locale.getDefault(); + } else { + result = request.getLocale(); + } + + return result; } } -- libgit2 0.21.2