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, 4 insertions, 0 deletions
diff --git a/modules/poll/poll.module b/modules/poll/poll.module
index f45b8bda7..561e160c4 100644
--- a/modules/poll/poll.module
+++ b/modules/poll/poll.module
@@ -485,6 +485,10 @@ function poll_load($nodes) {
foreach ($nodes as $node) {
$poll = db_query("SELECT runtime, active FROM {poll} WHERE nid = :nid", array(':nid' => $node->nid))->fetchObject();
+ if (empty($poll)) {
+ $poll = new stdClass;
+ }
+
// Load the appropriate choices into the $poll object.
$poll->choice = db_select('poll_choice', 'c')
->addTag('translatable')