Copilot commented on code in PR #3333:
URL: https://github.com/apache/tika/pull/3333#discussion_r4251996548


##########
tika-parsers/tika-parsers-standard/tika-parsers-standard-modules/tika-parser-microsoft-module/src/main/java/org/apache/tika/parser/microsoft/JackcessParser.java:
##########
@@ -108,10 +107,9 @@ public void parse(TikaInputStream tis, ContentHandler 
handler, Metadata metadata
             JackcessExtractor ex = new JackcessExtractor(metadata, context, 
locale);
             ex.parse(db, xhtml);
         } catch (IOException e) {
-            //TIKA-3849
-            if (e.getMessage() != null && 
e.getMessage().contains("Unrecognized map type: 75")) {
-                throw new UnsupportedFormatException(
-                        "Jackcess doesn't process mdb versions before v97");
+            if (e.getMessage().startsWith("invalid page number ") ||
+                e.getMessage().startsWith("Invalid usage map row ")) {
+                throw new TikaException("Corrupt Access database: " + 
e.getMessage(), e);
             }

Review Comment:
   `IOException.getMessage()` is nullable, so any message-less I/O failure 
while opening or extracting the database now throws a `NullPointerException` 
here instead of preserving the original `IOException`. This is especially 
harmful for embedded databases because that runtime exception is not isolated 
by `ParsingEmbeddedDocumentExtractor`; cache the message and guard it before 
matching these prefixes.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to