Fix crash on viewing md files in file viewer with tabs and spaces (#1243)

Closes #1239

Co-authored-by: M M Arif <mmarif@swatian.com>
Reviewed-on: https://codeberg.org/gitnex/GitNex/pulls/1243
Reviewed-by: qwerty287 <qwerty287@noreply.codeberg.org>
This commit is contained in:
M M Arif 2023-02-03 07:33:51 +00:00
parent 3332749ff2
commit 06a7eb5a0c
1 changed files with 5 additions and 1 deletions

View File

@ -51,7 +51,11 @@ public abstract class Language {
public static boolean isValid(String name) {
initializeMap();
return languages.containsKey(name.toUpperCase());
if (name != null) {
return languages.containsKey(name.toUpperCase());
} else {
return languages.containsKey(null);
}
}
public abstract Pattern getPattern(LanguageElement element);