Skip to content

Commit 33a1dc5

Browse files
committed
fix tests
1 parent ec14577 commit 33a1dc5

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

grails-plugin-gsp/src/main/groovy/org/grails/plugins/web/GroovyPagesGrailsPlugin.groovy

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -170,9 +170,9 @@ class GroovyPagesGrailsPlugin extends Plugin {
170170
resourceLoader = groovyPageResourceLoader
171171
}
172172
if (deployed) {
173-
def context = grailsApplication.mainContext
174-
def allViewsProperties = context.getResources("classpath*:gsp/views.properties")
175-
allViewsProperties = allViewsProperties.findAll { Resource r ->
173+
def context = grailsApplication?.mainContext
174+
def allViewsProperties = context?.getResources("classpath*:gsp/views.properties")
175+
allViewsProperties = allViewsProperties?.findAll { Resource r ->
176176
def p = r.URL.path
177177
if(warDeployed && p.contains('/WEB-INF/classes')) {
178178
return true
@@ -185,7 +185,7 @@ class GroovyPagesGrailsPlugin extends Plugin {
185185
}
186186
precompiledGspMap = { PropertiesFactoryBean pfb ->
187187
ignoreResourceNotFound = true
188-
locations = allViewsProperties as Resource[]
188+
locations = allViewsProperties ? allViewsProperties as Resource[] : 'classpath:gsp/views.properties'
189189
}
190190
}
191191
if (enableReload) {

0 commit comments

Comments
 (0)