From f7a9a1ca7b28d1ef6de33827da586cfe6544a5e0 Mon Sep 17 00:00:00 2001 From: Nick Burch Date: Thu, 24 Nov 2005 10:46:45 +0000 Subject: [PATCH] Fix NPE in case when we can't find the Document atom: throw an IllegalState instead git-svn-id: https://svn.apache.org/repos/asf/jakarta/poi/trunk@353797 13f79535-47bb-0310-9956-ffa450edef68 --- .../src/org/apache/poi/hslf/usermodel/SlideShow.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/scratchpad/src/org/apache/poi/hslf/usermodel/SlideShow.java b/src/scratchpad/src/org/apache/poi/hslf/usermodel/SlideShow.java index de85bf908..817bd0ce5 100644 --- a/src/scratchpad/src/org/apache/poi/hslf/usermodel/SlideShow.java +++ b/src/scratchpad/src/org/apache/poi/hslf/usermodel/SlideShow.java @@ -224,6 +224,12 @@ public class SlideShow } } + // Ensure we really found a Document record + // If we didn't, then the file is probably corrupt + if(documentRecord == null) { + throw new IllegalStateException("The PowerPoint file didn't contain a Document Record in its PersistPtr blocks. It is probably corrupt."); + } + // Now look for SlideListWithTexts in the most up-to-date Document Record //