Variable "protected" in class Sheet can be null when HSSFSheet.isProtected() is called. Because there is no error detection around this call stack, an error can be generated. A resolution is is to add the line if (protect == null) protect = (ProtectRecord)createProtect(); before the return statement in Sheet.isProtected() though I don't know if this is valid.
HSSFSheet.getProtected is the call. Sheet.getProtected (which returns the ProtectedRecord) will now create and add the ProtectedRecord to the list of records for the Sheet. Committed in SVN. Jason
*** Bug 27749 has been marked as a duplicate of this bug. ***
Original fix was in svn r368554 Follow-up info: Original test code (from bug 27749) is no longer valid: HSSFSheet sheet = workBook.cloneSheet(index); sheet.setProtect(true); The method HSSFSheet.setProtect(boolean) was deprecated (svn r552425 ) because it didn't set a password hash. As of the fix for bug 47363 (svn r784240 ), the deprecated method was removed. The test code for this problem would now look like this: HSSFSheet sheet = workBook.cloneSheet(index); sheet.protectSheet("secret"); This still works OK in svn trunk