diff --git a/src/main/java/com/hubspot/jackson/jaxrs/PropertyFilteringMessageBodyWriter.java b/src/main/java/com/hubspot/jackson/jaxrs/PropertyFilteringMessageBodyWriter.java index b267324..f41015d 100644 --- a/src/main/java/com/hubspot/jackson/jaxrs/PropertyFilteringMessageBodyWriter.java +++ b/src/main/java/com/hubspot/jackson/jaxrs/PropertyFilteringMessageBodyWriter.java @@ -153,13 +153,14 @@ private JacksonJsonProvider getJsonProvider() { return delegate; } - for (Object o : application.getSingletons()) { - if (o instanceof JacksonJsonProvider) { - delegate = (JacksonJsonProvider) o; - return delegate; - } + if( application != null ) { + for (Object o : application.getSingletons()){ + if (o instanceof JacksonJsonProvider) { + delegate = (JacksonJsonProvider) o; + return delegate; + } + } } - delegate = new JacksonJsonProvider(); return delegate; }