From 54bc9a30499ba7cc8efa0d360238b18dc1f111ac Mon Sep 17 00:00:00 2001
From: Vincent Massaro <vincent.massaro@yale.edu>
Date: Thu, 13 Nov 2014 16:20:35 -0500
Subject: [PATCH] check that #title exists before asserting it to avoid
 warnings

---
 better_field_descriptions.module | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/better_field_descriptions.module b/better_field_descriptions.module
index 2e3ef7e..2aa4541 100644
--- a/better_field_descriptions.module
+++ b/better_field_descriptions.module
@@ -140,7 +140,7 @@ function better_field_descriptions_form_alter(&$form, &$form_state, $form_id) {
 
             case 'between':
 
-              $label = (empty($data['label'])) ? $form[$field][LANGUAGE_NONE]['#title'] : $data['label'];
+              $label = (empty($data['label']) && !empty($form[$field][LANGUAGE_NONE]['#title'])) ? $form[$field][LANGUAGE_NONE]['#title'] : $data['label'];
               $form[$field][LANGUAGE_NONE]['#title_display'] = 'invisible';
               $form[$field][LANGUAGE_NONE][0]['#title_display'] = 'invisible';
               $position = '#prefix';
-- 
1.9.2

