Skip to content

Commit 07c11e7

Browse files
committed
[INTERNAL] graceful handling of non-language file-type
Fixes #181
1 parent aecc94d commit 07c11e7

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/main/java/net/seesharpsoft/intellij/plugins/csv/components/CsvFileAttributes.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,10 +120,9 @@ public void resetValueSeparator(@NotNull PsiFile psiFile) {
120120

121121
public @NotNull
122122
CsvValueSeparator getValueSeparator(Project project, VirtualFile virtualFile) {
123-
if (project == null || virtualFile == null) {
123+
if (project == null || virtualFile == null || !(virtualFile.getFileType() instanceof LanguageFileType)) {
124124
return CsvEditorSettings.getInstance().getDefaultValueSeparator();
125125
}
126-
assert(virtualFile.getFileType() instanceof LanguageFileType);
127126
Language language = ((LanguageFileType) virtualFile.getFileType()).getLanguage();
128127
if (language instanceof CsvSeparatorHolder) {
129128
return ((CsvSeparatorHolder) language).getSeparator();

0 commit comments

Comments
 (0)