Commit cc34982c8c5957fdd4f8d7a3eac7759a93609c35

Authored by Kevin Fourie
1 parent a2c45768

KTS-1890

"Fatal error occurs in Workflow Administration, Security, Action Restrictions (by state) , Fatal error: Call to a member function on a non-object in C:\Program Files\ktdmsdev\knowledgetree\plugins\ktstandard\PDFGeneratorAction.php on line 136"
Fixed. Added better null checking.

Reviewed By: Jalaloedien



git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@6509 c91229c3-7414-0410-bfa2-8a42b809f60b
plugins/ktstandard/PDFGeneratorAction.php
... ... @@ -132,6 +132,9 @@ class PDFGeneratorAction extends KTDocumentAction {
132 132 * @return string mime time extension
133 133 */
134 134 function getMimeExtension() {
  135 +
  136 + if($this->Document == null || $this->Document == "" || PEAR::isError($this->Document) ) return _kt('Unknown Type');
  137 +
135 138 $oDocument = $this->oDocument;
136 139 $iMimeTypeId = $oDocument->getMimeTypeID();
137 140 $mimetypename = KTMime::getMimeTypeName($iMimeTypeId); // mime type name
... ...