fix warning about array passed to substring

Fix warning thrown when empty array is passed as "messages"
to sheduler.
"Warning: substr() expects parameter 1 to be string,
array given in Observer.php on line 87"