Author: tfmorris Date: 2008-05-13 09:05:53-0700 New Revision: 14724 Modified: trunk/src/argouml-app/src/org/argouml/uml/reveng/FileImportUtils.java
Log: Protect against null file list Modified: trunk/src/argouml-app/src/org/argouml/uml/reveng/FileImportUtils.java Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/reveng/FileImportUtils.java?view=diff&rev=14724&p1=trunk/src/argouml-app/src/org/argouml/uml/reveng/FileImportUtils.java&p2=trunk/src/argouml-app/src/org/argouml/uml/reveng/FileImportUtils.java&r1=14723&r2=14724 ============================================================================== --- trunk/src/argouml-app/src/org/argouml/uml/reveng/FileImportUtils.java (original) +++ trunk/src/argouml-app/src/org/argouml/uml/reveng/FileImportUtils.java 2008-05-13 09:05:53-0700 @@ -107,26 +107,29 @@ } // Get the contents of the directory - for (File curFile : curDir.listFiles()) { + File[] files = curDir.listFiles(); + if (files != null) { + for (File curFile : curDir.listFiles()) { - // The following test can cause trouble with - // links, because links are accepted as - // directories, even if they link files. Links - // could also result in infinite loops. For this - // reason we don't do this traversing recursively. - if (curFile.isDirectory()) { - // If this file is a directory - if (recurse && !seenDirectories.contains(curFile)) { - toDoDirectories.add(curFile); - seenDirectories.add(curFile); - } - } else { - if (matchesSuffix(curFile, filters)) { - results.add(curFile); - } - } - } - } + // The following test can cause trouble with + // links, because links are accepted as + // directories, even if they link files. Links + // could also result in infinite loops. For this + // reason we don't do this traversing recursively. + if (curFile.isDirectory()) { + // If this file is a directory + if (recurse && !seenDirectories.contains(curFile)) { + toDoDirectories.add(curFile); + seenDirectories.add(curFile); + } + } else { + if (matchesSuffix(curFile, filters)) { + results.add(curFile); + } + } + } + } + } return results; } --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
