<?php
if ($app->has_error()) {
	foreach($app->get_all_errors() as $error) {
		echo "<div class=\"error\">$error</div>";
	}
}
?>

<?php
if (isset($app) && $app->has_error()) {
	foreach($app->get_all_errors() as $error) {
		echo "<div class=\"error\">$error</div>";
	}
}
?>

Check that we have an app object before using it
Check that we have an app object before using it
