]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-16587: portfolio/caller base class - be more defensive when asked to do things...
authormjollnir_ <mjollnir_>
Mon, 13 Oct 2008 10:12:05 +0000 (10:12 +0000)
committermjollnir_ <mjollnir_>
Mon, 13 Oct 2008 10:12:05 +0000 (10:12 +0000)
lib/portfolio/caller.php

index cf945be90740465a8e0ab20d429bf5b3d0f265f4..86f0dd3b2ebf4f9783450be2749bd34be798df68 100644 (file)
@@ -293,6 +293,9 @@ abstract class portfolio_caller_base {
     * for single or multi file exports.
     */
     public function prepare_package_file() {
+        if (empty($this->singlefile) && empty($this->multifiles)) {
+            throw new portfolio_caller_exception('invalidpreparepackagefile', 'portfolio', $this->get_return_url());
+        }
         if ($this->singlefile) {
             return $this->exporter->copy_existing_file($this->singlefile);
         }