Fix issue #1613
diff --git a/system/helpers/form_helper.php b/system/helpers/form_helper.php
index 0c5d550..1bccac3 100644
--- a/system/helpers/form_helper.php
+++ b/system/helpers/form_helper.php
@@ -340,8 +340,13 @@
 		{
 			$key = (string) $key;
 
-			if (is_array($val) && ! empty($val))
+			if (is_array($val))
 			{
+				if (empty($val))
+				{
+					continue;
+				}
+
 				$form .= '<optgroup label="'.$key."\">\n";
 
 				foreach ($val as $optgroup_key => $optgroup_val)