Switch order of literals to prevent NullPointerException

This commit is contained in:
pixeebot[bot] 2025-05-19 00:49:14 +00:00 committed by GitHub
parent 8a87aca0c2
commit bede9cde9b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -293,11 +293,11 @@ class PDFToFileTest {
boolean foundImage = false; boolean foundImage = false;
while ((entry = zipStream.getNextEntry()) != null) { while ((entry = zipStream.getNextEntry()) != null) {
if (entry.getName().equals("test.html")) { if ("test.html".equals(entry.getName())) {
foundMainHtml = true; foundMainHtml = true;
} else if (entry.getName().equals("test_ind.html")) { } else if ("test_ind.html".equals(entry.getName())) {
foundIndexHtml = true; foundIndexHtml = true;
} else if (entry.getName().equals("test_img.png")) { } else if ("test_img.png".equals(entry.getName())) {
foundImage = true; foundImage = true;
} }
zipStream.closeEntry(); zipStream.closeEntry();
@ -443,7 +443,7 @@ class PDFToFileTest {
boolean foundMediaFiles = false; boolean foundMediaFiles = false;
while ((entry = zipStream.getNextEntry()) != null) { while ((entry = zipStream.getNextEntry()) != null) {
if (entry.getName().equals("document.odp")) { if ("document.odp".equals(entry.getName())) {
foundMainFile = true; foundMainFile = true;
} else if (entry.getName().startsWith("document_media")) { } else if (entry.getName().startsWith("document_media")) {
foundMediaFiles = true; foundMediaFiles = true;