The file at above URL shows two slide masters in PowerPoint, but SlideShow.getSlideMasters() only returns one. This causes Slide.getMasterSheet() to throw a RuntimeException on the first slide. Even if the root cause (getSlideMasters()) is not fixed, I think it would be better for getMasterSheet() to simply return null if it can't find the master, instead of throwing exceptions. As it is, you are forced to try/catch a RuntimeException if you want to recover, but catching a RuntimeException is too broad, it may mask other exceptions that may come from the API.
Created attachment 20233 [details] copy of the file in case URL disappears
The first slide should return TitleMaster which is not yet supported. I need to think a little bit how to fit it in the current design. >Even if the root cause (getSlideMasters()) is not fixed, I think it would be >better for getMasterSheet() to simply return null if it can't find the master, >instead of throwing exceptions. I agree, it shouldn't be fatal and return null; >As it is, you are forced to try/catch a >RuntimeException if you want to recover, but catching a RuntimeException is too >broad, it may mask other exceptions that may come from the API. I'm going to replace RuntimeException with HSLFException extends RuntimeException. Should have done it long ago, but as always, I was distracted by other tasks.
I added support for Title Masters. Now Slide.getMasterSheet() returns not-null MasterSheet object - either SlideMaster or TitleMaster. Yegor