Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

XWPFNumbering.addAbstractNum will definitely throw an exception #171

Closed
wants to merge 1 commit into from

Conversation

Sayi
Copy link
Member

@Sayi Sayi commented Mar 23, 2020

XWPFNumbering.addAbstractNum code is an if branch. There are two points to note:

  1. When abstractNum.getAbstractNum () is not null, you must ensure that AbstractNumId has a value, so in order for users to find the correct AbstractNumId value, two getter methods are exposed, of course, the list cannot be modified.

  2. When abstractNum.getAbstractNum () is null, an exception will be thrown when cascading the method of abstractNum.getAbstractNum (), so you need to set the attribute CtAbstractNum of the abstractNum.

PS: For the first point, we can also assert in the XWPFNumbering.addAbstractNum that AbstractNumId is not null, fail fast.

@Alain-Bearez
Copy link
Contributor

applied by commit r1875747

this PR can be closed

@Sayi Sayi closed this Apr 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants