Avoid NPE with malformed master-style

This commit is contained in:
Dominik Stadler 2026-02-14 18:40:12 +01:00
parent e96c9e17c0
commit 692caf0f36
3 changed files with 4 additions and 0 deletions

View File

@ -112,6 +112,10 @@ public final class HSLFSlideMaster extends HSLFMasterSheet {
return null; return null;
} }
final TxMasterStyleAtom t = _txmaster[txtype]; final TxMasterStyleAtom t = _txmaster[txtype];
if (t == null) {
throw new IllegalStateException("Cannot get master-style for type " + txtype);
}
final List<TextPropCollection> styles = isCharacter ? t.getCharacterStyles() : t.getParagraphStyles(); final List<TextPropCollection> styles = isCharacter ? t.getCharacterStyles() : t.getParagraphStyles();
// TODO: what is the reaction for readOnly=false and styles.isEmpty()? // TODO: what is the reaction for readOnly=false and styles.isEmpty()?
final int minLevel = Math.min(level, styles.size()-1); final int minLevel = Math.min(level, styles.size()-1);

Binary file not shown.