--- l10n_server/l10n_community/export.inc	2008-01-17 22:11:06.000000000 +0100
+++ l10n_server/l10n_community/export.inc	2008-01-30 20:39:28.000000000 +0100
@@ -185,13 +185,18 @@ function l10n_community_export_form_subm
     ($type != 'translation'),
     $form_values['version']
   );
-  
-  // Return compressed archive to user.
-  header('Content-Disposition: attachment; filename='. $serve_name);
-  header('Content-Type: application/x-compressed');
-  echo file_get_contents($file_name);
-  unlink($file_name);
-  die();
+
+  if (empty($file_name) || empty($serve_name)) {
+    // Any Drupal message should be already set by l10n_community_export().
+    return;
+  } else { 
+    // Return compressed archive to user.
+    header('Content-Disposition: attachment; filename='. $serve_name);
+    header('Content-Type: application/x-compressed');
+    echo file_get_contents($file_name);
+    unlink($file_name);
+    die();
+  }
 }
 
 /**
@@ -247,6 +252,12 @@ function l10n_community_export($uri, $re
   $previous_sid = 0;
   $export_string = $string_files = array();
   $po_folder = ($version == 'drupal-5' ? 'po' : 'translations');
+
+  if (db_num_rows($result) <= 0) {
+    drupal_set_message('There are no strings in the selected release.');
+    return false;
+  }
+
     
   while ($string = db_fetch_object($result)) {
     if ($string->sid != $previous_sid) {
