Skip to content

Commit 1ee250b

Browse files
committed
Catch file not found exception and continue. Fixes #9741
1 parent 927a655 commit 1ee250b

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

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

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -217,11 +217,15 @@ class IOUtils extends SpringIOUtils {
217217
def rootResource = findRootResource(targetClass)
218218
if(rootResource != null) {
219219

220-
def rootFile = new UrlResource(rootResource).file.canonicalFile
220+
try {
221+
def rootFile = new UrlResource(rootResource).file.canonicalFile
221222

222-
def rootPath = rootFile.path
223-
if(rootPath.contains(BuildSettings.BUILD_CLASSES_PATH)) {
224-
return new File(rootPath - BuildSettings.BUILD_CLASSES_PATH)
223+
def rootPath = rootFile.path
224+
if(rootPath.contains(BuildSettings.BUILD_CLASSES_PATH)) {
225+
return new File(rootPath - BuildSettings.BUILD_CLASSES_PATH)
226+
}
227+
} catch (FileNotFoundException fnfe) {
228+
return null
225229
}
226230
}
227231
return null

0 commit comments

Comments
 (0)