From 1b2e068757625d302498a3059bec3a805c638c08 Mon Sep 17 00:00:00 2001 From: "alessandro.segala" Date: Sat, 20 Jun 2009 13:23:21 +0000 Subject: [PATCH] Tiny change. If we came here, it means that there is an error... But, at least make sure the script doesn't run into a Fatal Error. --- push/PushMonitor.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/push/PushMonitor.php b/push/PushMonitor.php index 6c604fe..5cf34cb 100644 --- a/push/PushMonitor.php +++ b/push/PushMonitor.php @@ -141,8 +141,11 @@ while(true) // If all 3 attempts failed... if($i == 3) { - $process->kill(); - $process = false; + if($process) + { + $process->kill(); + $process = false; + } error_log(date('Y-m-d H:i')." - Cannot send message:\n".$message."\nTo device: ".$deviceToken."\n\n", 3, 'PushErrors.log'); } }