summaryrefslogtreecommitdiff
path: root/modules/poll
diff options
context:
space:
mode:
Diffstat (limited to 'modules/poll')
-rw-r--r--modules/poll/poll.module4
1 files changed, 3 insertions, 1 deletions
diff --git a/modules/poll/poll.module b/modules/poll/poll.module
index 5dd356f1b..21d48cba2 100644
--- a/modules/poll/poll.module
+++ b/modules/poll/poll.module
@@ -366,7 +366,9 @@ function poll_choice_js() {
// not process it. We retreive the cached form, add the element, and resave.
$form_build_id = $_POST['form_build_id'];
$form_state = array('submitted' => FALSE);
- $form = form_get_cache($form_build_id, $form_state);
+ if (!$form = form_get_cache($form_build_id, $form_state)) {
+ exit();
+ }
$delta = count($_POST['choice']);
$key = isset($form['#node']->choice) ? 'new:'. ($delta - count($form['#node']->choice)) : 'new:'. $delta;