diff --git a/cake/libs/view/helpers/html.php b/cake/libs/view/helpers/html.php
index 5dfac23b2..9c5f003f6 100644
--- a/cake/libs/view/helpers/html.php
+++ b/cake/libs/view/helpers/html.php
@@ -898,7 +898,7 @@ class HtmlHelper extends AppHelper {
$hourValue = empty($selected) ? ($showEmpty ? NULL : date('H')) : $selected;
} else {
$hourValue = empty($selected) ? ($showEmpty ? NULL : date('g')) : $selected;
- if (intval($hourValue) == 0 && !$showEmpty) {
+ if (isset($selected) && intval($hourValue) == 0 && !$showEmpty) {
$hourValue = 12;
}
}