Switch order of literals to prevent NullPointerException

This commit is contained in:
pixeebot[bot] 2025-07-24 12:44:48 +00:00 committed by GitHub
parent f0b1cb11d0
commit 219790dcae
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -56,7 +56,7 @@ public class ConvertOfficeController {
// Check if the file is HTML and apply sanitization if needed
String fileExtension = FilenameUtils.getExtension(originalFilename).toLowerCase();
if (fileExtension.equals("html") || fileExtension.equals("htm")) {
if ("html".equals(fileExtension) || "htm".equals(fileExtension)) {
// Read and sanitize HTML content
String htmlContent = new String(inputFile.getBytes(), StandardCharsets.UTF_8);
String sanitizedHtml = customHtmlSanitizer.sanitize(htmlContent);