File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
src/main/java/net/seesharpsoft/intellij/plugins/csv/psi Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -262,12 +262,16 @@ public void deleteRow(@NotNull PsiElement row) {
262262 }
263263
264264 public void deleteRows (Collection <Integer > indices ) {
265- Set <PsiElement > toDelete = new HashSet <>();
266265 PsiFile psiFile = getPsiFile ();
266+ if (psiFile == null ) return ;
267+
268+ Set <PsiElement > toDelete = new HashSet <>();
267269 List <Integer > sortedIndices = new ArrayList <>(indices );
268270 Collections .sort (sortedIndices );
269271 for (int rowIndex : sortedIndices ) {
270272 CsvRecord row = PsiHelper .getNthChildOfType (psiFile , rowIndex , CsvRecord .class );
273+ if (row == null ) continue ;
274+
271275 boolean removePreviousLF = rowIndex > 0 ;
272276 PsiElement lf = PsiHelper .getSiblingOfType (row , CsvTypes .CRLF , removePreviousLF );
273277 if (lf == null || toDelete .contains (lf )) {
You can’t perform that action at this time.
0 commit comments