mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
FileTypeManagerImpl return null if file type is not found by name
GitOrigin-RevId: b51e76fa0245de79c0c10dfea807d8b66991f3c4
This commit is contained in:
committed by
intellij-monorepo-bot
parent
50ff05d624
commit
d153a0e89a
+7
-6
@@ -933,14 +933,15 @@ public class FileTypeManagerImpl extends FileTypeManagerEx implements Persistent
|
||||
FileType type = getStdFileType(fileTypeName);
|
||||
// TODO: Abstract file types are not std one, so need to be restored specially,
|
||||
// currently there are 6 of them and restoration does not happen very often so just iteration is enough
|
||||
if (type == PlainTextFileType.INSTANCE && !fileTypeName.equals(type.getName())) {
|
||||
for (FileType fileType: mySchemeManager.getAllSchemes()) {
|
||||
if (fileTypeName.equals(fileType.getName())) {
|
||||
return fileType;
|
||||
}
|
||||
if (type != PlainTextFileType.INSTANCE || fileTypeName.equals(type.getName())) {
|
||||
return type;
|
||||
}
|
||||
for (FileType fileType: mySchemeManager.getAllSchemes()) {
|
||||
if (fileTypeName.equals(fileType.getName())) {
|
||||
return fileType;
|
||||
}
|
||||
}
|
||||
return type;
|
||||
return null;
|
||||
}
|
||||
|
||||
private static boolean isDetectable(@NotNull final VirtualFile file) {
|
||||
|
||||
Reference in New Issue
Block a user