NullPointerException because "<local1>" is null

Getting this exception for some documents saved from google docs. (.docx)

java.lang.NullPointerException: Cannot invoke “com.groupdocs.viewer.internal.c.a.w.gi.bWY(int)” because “” is null

@Shakeel_Ahmed

The NullPointerException you are encountering when processing certain .docx documents saved from Google Docs may be due to the internal handling of specific document structures or content that the GroupDocs library is unable to process correctly. This type of error typically indicates that the code is attempting to access an object or variable that has not been initialized.

To troubleshoot this issue, consider the following steps:

  1. Check Document Compatibility: Ensure that the .docx files you are using are compatible with the version of the GroupDocs library you are implementing. Sometimes, documents created in different environments (like Google Docs) may contain elements that are not fully supported.

  2. Review Error Logs: The stack trace you provided indicates that the error occurs within the GroupDocs viewer’s internal methods. It may be helpful to log additional details about the document being processed, such as its content or structure, to identify any specific elements causing the issue.

  3. Test with Different Documents: Try processing other .docx files to see if the issue is isolated to specific documents. If the problem persists across multiple files, it may indicate a broader compatibility issue.

  4. Contact Support: If you continue to experience this issue, consider reaching out to GroupDocs support with the problematic document and details about your development environment. Providing a sample application that reproduces the issue can help them diagnose the problem more effectively.

  5. Check for Updates: Ensure that you are using the latest version of the GroupDocs library, as updates may include bug fixes and improvements that could resolve your issue.

If you have any further questions or need additional assistance, feel free to ask!

More details

| com.groupdocs.viewer.exception.GroupDocsException: java.lang.RuntimeException: java.lang.NullPointerException: Cannot invoke “com.groupdocs.viewer.internal.c.a.w.gi.bWY(int)” because “” is null
| at com.groupdocs.viewer.domain.documents.F.cK(Unknown Source)
| at com.groupdocs.viewer.domain.documents.F.getPages(Unknown Source)
| at com.groupdocs.viewer.domain.documents.F.cJ(Unknown Source)
| at com.groupdocs.viewer.Viewer.a(Unknown Source)
| at com.groupdocs.viewer.Viewer.getViewInfo(Unknown Source)

@Shakeel_Ahmed Thank you for the information.

  1. Which version of the GroupDocs.Total library are you using?
  2. Could you share a document that causes the issue? This will help expedite the resolution.
  3. Please try to reproduce the bug with Locale.setDefault(Locale.US); before using the GroupDocs.Total library.

Here are the versions of java <groupdoc.viewer.version>24.8</groupdoc.viewer.version>
<groupdoc.editor.version>24.9</groupdoc.editor.version>
Test_doc.docx (308.6 KB)

Uploaded the document

It can be any document saved from google docs. You can use attached or save meeting notes template from google docs.

@Shakeel_Ahmed Thank you for the information provided.
I have reproduced the problem and created an issue with ID VIEWERJAVA-3720. I will investigate the problem further.

Hint: docProps is a folder if you unzip .docx file that is removed when google docs save document. This is however present when MS Word save .docx file. docProps
docProps have information related to pages and local1 seems to be caused due to missed page numbers.

with docProps.png (28.4 KB)

without docProps.png (38.4 KB)

Thank you for the information. We plan to include the fix in 24.12 and will update you here.