We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Condition Specified but with no condition passes linting but fails deploy
### CloudFormation Lint Version

0.83.1

### What operating system are you using?

mac/ubuntu

### Describe the bug

in a cfn template if you specify root level item `Conditions` but have no conditions this passes cfn-lint but always fails on deploy

### Expected behavior

cfn-lint should fail if there is a Conditions root level object but no array entries under it.

### Reproduction template

```
AWSTemplateFormatVersion: "2010-09-09"
Parameters:
  myParam
Conditions:
Resources:
  myTopic:
    Type: AWS::SNS::Topic
    Properties:
      DisplayName: mytopic
      TopicName: mytopic
```

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `src/cfnlint/rules/conditions/Configuration.py`
Content:
```
1 """
2 Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 SPDX-License-Identifier: MIT-0
4 """
5 
6 from cfnlint.rules import CloudFormationLintRule, RuleMatch
7 
8 
9 class Configuration(CloudFormationLintRule):
10     """Check if Conditions are configured correctly"""
11 
12     id = "E8001"
13     shortdesc = "Conditions have appropriate properties"
14     description = "Check if Conditions are properly configured"
15     source_url = "https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/conditions-section-structure.html"
16     tags = ["conditions"]
17 
18     condition_keys = [
19         "Condition",
20         "Fn::And",
21         "Fn::Equals",
22         "Fn::Not",
23         "Fn::Or",
24     ]
25 
26     def match(self, cfn):
27         matches = []
28 
29         conditions = cfn.template.get("Conditions", {})
30         if conditions:
31             for condname, condobj in conditions.items():
32                 if not isinstance(condobj, dict):
33                     message = "Condition {0} has invalid property"
34                     matches.append(
35                         RuleMatch(["Conditions", condname], message.format(condname))
36                     )
37                 else:
38                     if len(condobj) != 1:
39                         message = "Condition {0} has too many intrinsic conditions"
40                         matches.append(
41                             RuleMatch(
42                                 ["Conditions", condname], message.format(condname)
43                             )
44                         )
45                     else:
46                         for k, _ in condobj.items():
47                             if k not in self.condition_keys:
48                                 message = "Condition {0} has invalid property {1}"
49                                 matches.append(
50                                     RuleMatch(
51                                         ["Conditions", condname] + [k],
52                                         message.format(condname, k),
53                                     )
54                                 )
55 
56         return matches
57
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/src/cfnlint/rules/conditions/Configuration.py b/src/cfnlint/rules/conditions/Configuration.py
--- a/src/cfnlint/rules/conditions/Configuration.py
+++ b/src/cfnlint/rules/conditions/Configuration.py
@@ -26,8 +26,10 @@
     def match(self, cfn):
         matches = []
 
-        conditions = cfn.template.get("Conditions", {})
-        if conditions:
+        if "Conditions" not in cfn.template:
+            return matches
+        conditions = cfn.template.get("Conditions", None)
+        if isinstance(conditions, dict):
             for condname, condobj in conditions.items():
                 if not isinstance(condobj, dict):
                     message = "Condition {0} has invalid property"
@@ -52,5 +54,12 @@
                                         message.format(condname, k),
                                     )
                                 )
+        else:
+            matches.append(
+                RuleMatch(
+                    ["Conditions"],
+                    "Condition must be an object",
+                )
+            )
 
         return matches

{"golden_diff": "diff --git a/src/cfnlint/rules/conditions/Configuration.py b/src/cfnlint/rules/conditions/Configuration.py\n--- a/src/cfnlint/rules/conditions/Configuration.py\n+++ b/src/cfnlint/rules/conditions/Configuration.py\n@@ -26,8 +26,10 @@\n     def match(self, cfn):\n         matches = []\n \n-        conditions = cfn.template.get(\"Conditions\", {})\n-        if conditions:\n+        if \"Conditions\" not in cfn.template:\n+            return matches\n+        conditions = cfn.template.get(\"Conditions\", None)\n+        if isinstance(conditions, dict):\n             for condname, condobj in conditions.items():\n                 if not isinstance(condobj, dict):\n                     message = \"Condition {0} has invalid property\"\n@@ -52,5 +54,12 @@\n                                         message.format(condname, k),\n                                     )\n                                 )\n+        else:\n+            matches.append(\n+                RuleMatch(\n+                    [\"Conditions\"],\n+                    \"Condition must be an object\",\n+                )\n+            )\n \n         return matches\n", "issue": "Condition Specified but with no condition passes linting but fails deploy\n### CloudFormation Lint Version\r\n\r\n0.83.1\r\n\r\n### What operating system are you using?\r\n\r\nmac/ubuntu\r\n\r\n### Describe the bug\r\n\r\nin a cfn template if you specify root level item `Conditions` but have no conditions this passes cfn-lint but always fails on deploy\r\n\r\n### Expected behavior\r\n\r\ncfn-lint should fail if there is a Conditions root level object but no array entries under it.\r\n\r\n### Reproduction template\r\n\r\n```\r\nAWSTemplateFormatVersion: \"2010-09-09\"\r\nParameters:\r\n  myParam\r\nConditions:\r\nResources:\r\n  myTopic:\r\n    Type: AWS::SNS::Topic\r\n    Properties:\r\n      DisplayName: mytopic\r\n      TopicName: mytopic\r\n```\n", "before_files": [{"content": "\"\"\"\nCopyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\nSPDX-License-Identifier: MIT-0\n\"\"\"\n\nfrom cfnlint.rules import CloudFormationLintRule, RuleMatch\n\n\nclass Configuration(CloudFormationLintRule):\n    \"\"\"Check if Conditions are configured correctly\"\"\"\n\n    id = \"E8001\"\n    shortdesc = \"Conditions have appropriate properties\"\n    description = \"Check if Conditions are properly configured\"\n    source_url = \"https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/conditions-section-structure.html\"\n    tags = [\"conditions\"]\n\n    condition_keys = [\n        \"Condition\",\n        \"Fn::And\",\n        \"Fn::Equals\",\n        \"Fn::Not\",\n        \"Fn::Or\",\n    ]\n\n    def match(self, cfn):\n        matches = []\n\n        conditions = cfn.template.get(\"Conditions\", {})\n        if conditions:\n            for condname, condobj in conditions.items():\n                if not isinstance(condobj, dict):\n                    message = \"Condition {0} has invalid property\"\n                    matches.append(\n                        RuleMatch([\"Conditions\", condname], message.format(condname))\n                    )\n                else:\n                    if len(condobj) != 1:\n                        message = \"Condition {0} has too many intrinsic conditions\"\n                        matches.append(\n                            RuleMatch(\n                                [\"Conditions\", condname], message.format(condname)\n                            )\n                        )\n                    else:\n                        for k, _ in condobj.items():\n                            if k not in self.condition_keys:\n                                message = \"Condition {0} has invalid property {1}\"\n                                matches.append(\n                                    RuleMatch(\n                                        [\"Conditions\", condname] + [k],\n                                        message.format(condname, k),\n                                    )\n                                )\n\n        return matches\n", "path": "src/cfnlint/rules/conditions/Configuration.py"}], "after_files": [{"content": "\"\"\"\nCopyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\nSPDX-License-Identifier: MIT-0\n\"\"\"\n\nfrom cfnlint.rules import CloudFormationLintRule, RuleMatch\n\n\nclass Configuration(CloudFormationLintRule):\n    \"\"\"Check if Conditions are configured correctly\"\"\"\n\n    id = \"E8001\"\n    shortdesc = \"Conditions have appropriate properties\"\n    description = \"Check if Conditions are properly configured\"\n    source_url = \"https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/conditions-section-structure.html\"\n    tags = [\"conditions\"]\n\n    condition_keys = [\n        \"Condition\",\n        \"Fn::And\",\n        \"Fn::Equals\",\n        \"Fn::Not\",\n        \"Fn::Or\",\n    ]\n\n    def match(self, cfn):\n        matches = []\n\n        if \"Conditions\" not in cfn.template:\n            return matches\n        conditions = cfn.template.get(\"Conditions\", None)\n        if isinstance(conditions, dict):\n            for condname, condobj in conditions.items():\n                if not isinstance(condobj, dict):\n                    message = \"Condition {0} has invalid property\"\n                    matches.append(\n                        RuleMatch([\"Conditions\", condname], message.format(condname))\n                    )\n                else:\n                    if len(condobj) != 1:\n                        message = \"Condition {0} has too many intrinsic conditions\"\n                        matches.append(\n                            RuleMatch(\n                                [\"Conditions\", condname], message.format(condname)\n                            )\n                        )\n                    else:\n                        for k, _ in condobj.items():\n                            if k not in self.condition_keys:\n                                message = \"Condition {0} has invalid property {1}\"\n                                matches.append(\n                                    RuleMatch(\n                                        [\"Conditions\", condname] + [k],\n                                        message.format(condname, k),\n                                    )\n                                )\n        else:\n            matches.append(\n                RuleMatch(\n                    [\"Conditions\"],\n                    \"Condition must be an object\",\n                )\n            )\n\n        return matches\n", "path": "src/cfnlint/rules/conditions/Configuration.py"}]}