Skip to content

Commit 87a7e6b

Browse files
committed
Merge branch '3.0.x' into 3.1.x
2 parents 1af1630 + 1ee250b commit 87a7e6b

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

grails-bootstrap/src/main/groovy/grails/io/IOUtils.groovy

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -248,12 +248,16 @@ class IOUtils extends SpringIOUtils {
248248
def rootResource = findRootResource(targetClass)
249249
if(rootResource != null) {
250250

251-
def rootFile = new UrlResource(rootResource).file.canonicalFile
251+
try {
252+
def rootFile = new UrlResource(rootResource).file.canonicalFile
253+
def rootPath = rootFile.path
254+
def buildClassespath = BuildSettings.BUILD_CLASSES_PATH.replace('/', File.separator)
255+
if(rootPath.contains(buildClassespath)) {
256+
return new File(rootPath - buildClassespath)
252257

253-
def rootPath = rootFile.path
254-
def buildClassespath = BuildSettings.BUILD_CLASSES_PATH.replace('/', File.separator)
255-
if(rootPath.contains(buildClassespath)) {
256-
return new File(rootPath - buildClassespath)
258+
}
259+
} catch (FileNotFoundException fnfe) {
260+
return null
257261
}
258262
}
259263
return null

0 commit comments

Comments
 (0)