diff --git a/fastjsonschema/draft04.py b/fastjsonschema/draft04.py
index 7dd097e..8c25863 100644
--- a/fastjsonschema/draft04.py
+++ b/fastjsonschema/draft04.py
@@ -413,19 +413,23 @@ class CodeGeneratorDraft04(CodeGenerator):
                             self.exc('{name} must contain only specified items', rule='items')
                     else:
                         with self.l('for {variable}_x, {variable}_item in enumerate({variable}[{0}:], {0}):', len(items_definition)):
-                            self.generate_func_code_block(
+                            count = self.generate_func_code_block(
                                 self._definition['additionalItems'],
                                 '{}_item'.format(self._variable),
                                 '{}[{{{}_x}}]'.format(self._variable_name, self._variable),
                             )
+                            if count == 0:
+                                self.l('pass')
             else:
                 if items_definition:
                     with self.l('for {variable}_x, {variable}_item in enumerate({variable}):'):
-                        self.generate_func_code_block(
+                        count = self.generate_func_code_block(
                             items_definition,
                             '{}_item'.format(self._variable),
                             '{}[{{{}_x}}]'.format(self._variable_name, self._variable),
                         )
+                        if count == 0:
+                            self.l('pass')
 
     def generate_min_properties(self):
         self.create_variable_is_dict()
diff --git a/fastjsonschema/generator.py b/fastjsonschema/generator.py
index 5e08030..c5b57aa 100644
--- a/fastjsonschema/generator.py
+++ b/fastjsonschema/generator.py
@@ -143,6 +143,8 @@ class CodeGenerator:
     def generate_func_code_block(self, definition, variable, variable_name, clear_variables=False):
         """
         Creates validation rules for current definition.
+
+        Returns the number of validation rules generated as code.
         """
         backup = self._definition, self._variable, self._variable_name
         self._definition, self._variable, self._variable_name = definition, variable, variable_name
@@ -150,25 +152,31 @@ class CodeGenerator:
             backup_variables = self._variables
             self._variables = set()
 
-        self._generate_func_code_block(definition)
+        count = self._generate_func_code_block(definition)
 
         self._definition, self._variable, self._variable_name = backup
         if clear_variables:
             self._variables = backup_variables
 
+        return count
+
     def _generate_func_code_block(self, definition):
         if not isinstance(definition, dict):
             raise JsonSchemaDefinitionException("definition must be an object")
         if '$ref' in definition:
             # needed because ref overrides any sibling keywords
-            self.generate_ref()
+            return self.generate_ref()
         else:
-            self.run_generate_functions(definition)
+            return self.run_generate_functions(definition)
 
     def run_generate_functions(self, definition):
+        """Returns the number of generate functions that were executed."""
+        count = 0
         for key, func in self._json_keywords_to_function.items():
             if key in definition:
                 func()
+                count += 1
+        return count
 
     def generate_ref(self):
         """

diff --git a/tests/test_array.py b/tests/test_array.py
index 99c9254..3da479f 100644
--- a/tests/test_array.py
+++ b/tests/test_array.py
@@ -180,3 +180,22 @@ def test_mixed_arrays(asserter, value, expected):
         },
     }, value, expected)
 
+
+def test_issue_114(asserter):
+    """Prevent the faulty scheme to generate an empty for-loop."""
+    schema = {
+        "type": "object",
+        "properties": {
+            "a": {
+                "type": "array",
+                "items": {
+                    "b": {
+                        "type": "string"
+                    }
+                }
+            }
+        }
+    }
+    value = {"a": []}
+    expected = value
+    asserter(schema, value, expected)

Missleading IndentationError with a faulty schema
The following (faulty) schema

```
{
    "type": "object",
    "properties": {
        "a": {
            "type": "array",
            "items": {
                "b": {
                    "type": "string"
                }
            }
        }
    }
}
```

raises a missleading `IndentationError: expected an indented block`. This is especially confusing as jsonschema does not raise an error.
tests/test_array.py::test_issue_114
tests/test_array.py::test_array[0-expected0] tests/test_array.py::test_array[None-expected1] tests/test_array.py::test_array[True-expected2] tests/test_array.py::test_array[False-expected3] tests/test_array.py::test_array[abc-expected4] tests/test_array.py::test_array[value5-expected5] tests/test_array.py::test_array[value6-expected6] tests/test_array.py::test_array[value7-expected7] tests/test_array.py::test_max_items[value0-expected0] tests/test_array.py::test_max_items[value1-expected1] tests/test_array.py::test_max_items[value2-expected2] tests/test_array.py::test_max_items[value3-expected3] tests/test_array.py::test_min_items[value0-expected0] tests/test_array.py::test_min_items[value1-expected1] tests/test_array.py::test_min_items[value2-expected2] tests/test_array.py::test_min_items[value3-expected3] tests/test_array.py::test_unique_items[value0-expected0] tests/test_array.py::test_unique_items[value1-expected1] tests/test_array.py::test_unique_items[value2-expected2] tests/test_array.py::test_unique_items[value3-expected3] tests/test_array.py::test_unique_items[value4-expected4] tests/test_array.py::test_unique_items[value5-expected5] tests/test_array.py::test_unique_items[value6-expected6] tests/test_array.py::test_unique_items[value7-expected7] tests/test_array.py::test_unique_items[value8-expected8] tests/test_array.py::test_unique_items[value9-expected9] tests/test_array.py::test_unique_items[value10-expected10] tests/test_array.py::test_unique_items[value11-expected11] tests/test_array.py::test_unique_items[value12-expected12] tests/test_array.py::test_unique_items[value13-expected13] tests/test_array.py::test_unique_items[value14-expected14] tests/test_array.py::test_unique_items[value15-expected15] tests/test_array.py::test_unique_items[value16-expected16] tests/test_array.py::test_unique_items[value17-expected17] tests/test_array.py::test_min_and_unique_items tests/test_array.py::test_items_all_same[value0-expected0] tests/test_array.py::test_items_all_same[value1-expected1] tests/test_array.py::test_items_all_same[value2-expected2] tests/test_array.py::test_different_items[value0-expected0] tests/test_array.py::test_different_items[value1-expected1] tests/test_array.py::test_different_items[value2-expected2] tests/test_array.py::test_different_items[value3-expected3] tests/test_array.py::test_different_items[value4-expected4] tests/test_array.py::test_different_items[value5-expected5] tests/test_array.py::test_different_items_with_additional_items[value0-expected0] tests/test_array.py::test_different_items_with_additional_items[value1-expected1] tests/test_array.py::test_different_items_with_additional_items[value2-expected2] tests/test_array.py::test_different_items_with_additional_items[value3-expected3] tests/test_array.py::test_different_items_with_additional_items[value4-expected4] tests/test_array.py::test_different_items_with_additional_items[value5-expected5] tests/test_array.py::test_different_items_without_additional_items[value0-expected0] tests/test_array.py::test_different_items_without_additional_items[value1-expected1] tests/test_array.py::test_different_items_without_additional_items[value2-expected2] tests/test_array.py::test_different_items_without_additional_items[value3-expected3] tests/test_array.py::test_different_items_without_additional_items[value4-expected4] tests/test_array.py::test_different_items_without_additional_items[value5-expected5] tests/test_array.py::test_tuples_as_arrays[value0-expected0] tests/test_array.py::test_tuples_as_arrays[value1-expected1] tests/test_array.py::test_tuples_as_arrays[value2-expected2] tests/test_array.py::test_tuples_as_arrays[value3-expected3] tests/test_array.py::test_mixed_arrays[value0-expected0] tests/test_array.py::test_mixed_arrays[value1-expected1]