Package: biabam / 0.9.7-7

01_check_empty_recipients.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
Author: Thierry Randrianiriana <randrianiriana@gmail.com>
Description: see bug #386969.
--- biabam-0.9.7.orig/biabam
+++ biabam-0.9.7/biabam
@@ -148,7 +148,17 @@
   RECIPIENTS="$RECIPIENTS ${ARR_EMAILS[$i]}"
 done
 
-cat $TEMPFILE | $SENDMAIL $SENDMAIL_OPTS $RECIPIENTS # here we call sendmail
+if [[ -z $RECIPIENTS ]]; then
+  echo "Biabam is unable to find the recipients."
+  #clean
+  for i in `seq 1 $TOTAL_ATTACHMENTS`; do
+    /bin/rm -f ${TEMPUUENCODED[$i]} # remove all temp files created
+  done
+  /bin/rm -f $TEMPFILE # remove the email source code tempfile
+  exit 1
+else
+  cat $TEMPFILE | $SENDMAIL $SENDMAIL_OPTS $RECIPIENTS # here we call sendmail
+fi
 
 for i in `seq 1 $TOTAL_ATTACHMENTS`; do
   /bin/rm -f ${TEMPUUENCODED[$i]} # remove all temp files created