Catch the IllegalArgumentException, that can be thrown by VcsManager.createCommand().
1.1 --- a/refactoring.vcs/src/org/netbeans/modules/refactoring/vcs/ReadOnlyFilesHandlerImpl.java Sun Jul 31 19:05:30 2005 +0000
1.2 +++ b/refactoring.vcs/src/org/netbeans/modules/refactoring/vcs/ReadOnlyFilesHandlerImpl.java Mon Aug 01 17:58:27 2005 +0000
1.3 @@ -33,7 +33,13 @@
1.4 public Problem createProblem(Collection files) {
1.5 //if files cannot be handled by VCS return null
1.6 FileObject[] fos = (FileObject[]) files.toArray(new FileObject[0]);
1.7 - Command editCmd = VcsManager.getDefault().createCommand("EDIT", fos); //NOI18N
1.8 + Command editCmd;
1.9 + try {
1.10 + editCmd = VcsManager.getDefault().createCommand("EDIT", fos); //NOI18N
1.11 + } catch (IllegalArgumentException iaex) {
1.12 + // The provided files are not under version control
1.13 + editCmd = null;
1.14 + }
1.15 if (editCmd == null) return null;
1.16 fos = editCmd.getApplicableFiles(fos);
1.17 editCmd.setFiles(fos);