Prechádzať zdrojové kódy

Merge pull request #13 from almasaeed2010/7.x-1.x

Check if the upload field is available before loading the file
Lacey-Anne Sanderson 8 rokov pred
rodič
commit
bedc07830a
1 zmenil súbory, kde vykonal 4 pridanie a 1 odobranie
  1. 4 1
      includes/blast_ui.form_per_program.inc

+ 4 - 1
includes/blast_ui.form_per_program.inc

@@ -299,7 +299,10 @@ function blast_ui_per_blast_program_form_validate($form, &$form_state) {
   //----------------
   // @todo: We are currently not validating uploaded files are valid FASTA.
   // First check to see if we have an upload & if so then validate it.
-  $file = file_load($form_state['values']['UPLOAD']);
+  $file = null;
+  if(isset($form_state['values']['UPLOAD'])) {
+    $file = file_load($form_state['values']['UPLOAD']);
+  }
   // If the $file is populated then this is a newly uploaded, temporary file.
   if (is_object($file)) {
     $form_state['qFlag'] = 'upQuery';