diff --git a/HISTORY.rst b/HISTORY.rst
index b2d240b..c1e65a8 100644
--- a/HISTORY.rst
+++ b/HISTORY.rst
@@ -2,6 +2,10 @@
 History
 =======
 
+* Handle ``requestContext`` being ``None``, as can happen from Lambda invoke.
+
+  Thanks to scottmn for the report in `Issue #289 <https://github.com/adamchainz/apig-wsgi/issues/289>`__.
+
 2.12.0 (2021-08-24)
 -------------------
 
diff --git a/src/apig_wsgi/__init__.py b/src/apig_wsgi/__init__.py
index 2d1389d..0217ad6 100644
--- a/src/apig_wsgi/__init__.py
+++ b/src/apig_wsgi/__init__.py
@@ -58,7 +58,11 @@ def make_lambda_handler(
 
     def handler(event: Dict[str, Any], context: Any) -> Dict[str, Any]:
         # ALB doesn't send a version, but requestContext will contain a key named 'elb'.
-        if "requestContext" in event and "elb" in event["requestContext"]:
+        if (
+            "requestContext" in event
+            and isinstance(event["requestContext"], dict)
+            and "elb" in event["requestContext"]
+        ):
             version = "alb"
         else:
             version = event.get("version", "1.0")

diff --git a/tests/test_apig_wsgi.py b/tests/test_apig_wsgi.py
index 7697d40..528ae91 100644
--- a/tests/test_apig_wsgi.py
+++ b/tests/test_apig_wsgi.py
@@ -1,7 +1,17 @@
 import sys
 from base64 import b64encode
 from io import BytesIO
-from typing import Any, Callable, Dict, Generator, Iterable, List, Optional, Tuple
+from typing import (
+    Any,
+    Callable,
+    Dict,
+    Generator,
+    Iterable,
+    List,
+    Optional,
+    Tuple,
+    Union,
+)
 
 import pytest
 
@@ -82,6 +92,13 @@ class ContextStub:
 # v1 tests
 
 
+class Sentinel:
+    pass
+
+
+SENTINEL = Sentinel()
+
+
 def make_v1_event(
     *,
     method: str = "GET",
@@ -92,7 +109,7 @@ def make_v1_event(
     headers_multi: bool = True,
     body: str = "",
     binary: bool = False,
-    request_context: Optional[Dict[str, Any]] = None,
+    request_context: Union[Dict[str, Any], None, Sentinel] = SENTINEL,
 ) -> Dict[str, Any]:
     if headers is None:
         headers = {"Host": ["example.com"]}
@@ -125,7 +142,7 @@ def make_v1_event(
         event["body"] = body
         event["isBase64Encoded"] = False
 
-    if request_context is not None:
+    if request_context is not SENTINEL:
         event["requestContext"] = request_context
 
     return event
@@ -507,6 +524,14 @@ class TestV1Events:
 
         assert simple_app.environ["apig_wsgi.request_context"] == context
 
+    def test_request_context_none(self, simple_app: App) -> None:
+        # Invoking lambdas can lead to requestContext being JSON null
+        event = make_v1_event(request_context=None)
+
+        simple_app.handler(event, None)
+
+        # Simply don't crash
+
     def test_full_event(self, simple_app: App) -> None:
         event = make_v1_event()
 

Error when requestContext is None
### Python Version

3.8

### Package Version

2.12.0

### Description

I have a lambda that is called through API Gateway, but can also be invoked directly via a lambda client.  Upgrading to 2.12.0 started causing this error when invoked via client.
```
[ERROR] TypeError: argument of type 'NoneType' is not iterable
Traceback (most recent call last):
  File "/var/task/apig_wsgi/__init__.py", line 61, in handler
    if "requestContext" in event and "elb" in event["requestContext"]:
```

This is being done from Kotlin code, using `com.amazonaws.services.lambda.AWSLambda` client.  When an `AwsProxyRequest` object is constructed, it has `requestContext=null` by default.  This results in the error above.

I can update my invoke code to set a dummy requestContext, but I do believe it is valid to be None in the direct lambda invocation use case.  Does it make sense to add a `not None` check here for requestContext?

Thanks.


tests/test_apig_wsgi.py::TestV1Events::test_request_context_none
tests/test_apig_wsgi.py::TestV1Events::test_get tests/test_apig_wsgi.py::TestV1Events::test_get_missing_content_type tests/test_apig_wsgi.py::TestV1Events::test_get_single_header tests/test_apig_wsgi.py::TestV1Events::test_get_binary_support_default_text_content_types[text/plain] tests/test_apig_wsgi.py::TestV1Events::test_get_binary_support_default_text_content_types[text/html] tests/test_apig_wsgi.py::TestV1Events::test_get_binary_support_default_text_content_types[application/json] tests/test_apig_wsgi.py::TestV1Events::test_get_binary_support_default_text_content_types[application/vnd.api+json] tests/test_apig_wsgi.py::TestV1Events::test_get_binary_support_custom_text_content_types[test/custom] tests/test_apig_wsgi.py::TestV1Events::test_get_binary_support_custom_text_content_types[application/vnd.custom] tests/test_apig_wsgi.py::TestV1Events::test_get_binary_support_binary tests/test_apig_wsgi.py::TestV1Events::test_get_binary_support_binary_default_text_with_gzip_content_encoding[text/plain] tests/test_apig_wsgi.py::TestV1Events::test_get_binary_support_binary_default_text_with_gzip_content_encoding[text/html] tests/test_apig_wsgi.py::TestV1Events::test_get_binary_support_binary_default_text_with_gzip_content_encoding[application/json] tests/test_apig_wsgi.py::TestV1Events::test_get_binary_support_binary_default_text_with_gzip_content_encoding[application/vnd.api+json] tests/test_apig_wsgi.py::TestV1Events::test_get_binary_support_binary_custom_text_with_gzip_content_encoding[test/custom] tests/test_apig_wsgi.py::TestV1Events::test_get_binary_support_binary_custom_text_with_gzip_content_encoding[application/vnd.custom] tests/test_apig_wsgi.py::TestV1Events::test_get_binary_support_no_content_type tests/test_apig_wsgi.py::TestV1Events::test_post tests/test_apig_wsgi.py::TestV1Events::test_post_binary_support tests/test_apig_wsgi.py::TestV1Events::test_path_unquoting tests/test_apig_wsgi.py::TestV1Events::test_querystring_none tests/test_apig_wsgi.py::TestV1Events::test_querystring_none_single tests/test_apig_wsgi.py::TestV1Events::test_querystring_empty tests/test_apig_wsgi.py::TestV1Events::test_querystring_empty_single tests/test_apig_wsgi.py::TestV1Events::test_querystring_one tests/test_apig_wsgi.py::TestV1Events::test_querystring_one_single tests/test_apig_wsgi.py::TestV1Events::test_querystring_encoding_plus_value tests/test_apig_wsgi.py::TestV1Events::test_querystring_encoding_plus_key tests/test_apig_wsgi.py::TestV1Events::test_querystring_multi tests/test_apig_wsgi.py::TestV1Events::test_querystring_multi_encoding_plus_value tests/test_apig_wsgi.py::TestV1Events::test_querystring_multi_encoding_plus_key tests/test_apig_wsgi.py::TestV1Events::test_plain_header tests/test_apig_wsgi.py::TestV1Events::test_plain_header_single tests/test_apig_wsgi.py::TestV1Events::test_plain_header_multi tests/test_apig_wsgi.py::TestV1Events::test_special_headers tests/test_apig_wsgi.py::TestV1Events::test_special_content_type tests/test_apig_wsgi.py::TestV1Events::test_special_host tests/test_apig_wsgi.py::TestV1Events::test_special_x_forwarded_for tests/test_apig_wsgi.py::TestV1Events::test_x_forwarded_proto tests/test_apig_wsgi.py::TestV1Events::test_x_forwarded_port tests/test_apig_wsgi.py::TestV1Events::test_no_headers tests/test_apig_wsgi.py::TestV1Events::test_headers_None tests/test_apig_wsgi.py::TestV1Events::test_exc_info tests/test_apig_wsgi.py::TestV1Events::test_request_context tests/test_apig_wsgi.py::TestV1Events::test_full_event tests/test_apig_wsgi.py::TestV1Events::test_elb_health_check tests/test_apig_wsgi.py::TestV1Events::test_context tests/test_apig_wsgi.py::TestV1Events::test_empty_and_uncloseable_content tests/test_apig_wsgi.py::TestAlbEvents::test_querystring_encoding_plus_value tests/test_apig_wsgi.py::TestAlbEvents::test_querystring_encoding_plus_key tests/test_apig_wsgi.py::TestAlbEvents::test_querystring_multi tests/test_apig_wsgi.py::TestAlbEvents::test_querystring_multi_encoding_plus_value tests/test_apig_wsgi.py::TestAlbEvents::test_querystring_multi_encoding_plus_key tests/test_apig_wsgi.py::TestAlbEvents::test_querystring_contains_encoded_value tests/test_apig_wsgi.py::TestAlbEvents::test_querystring_multi_contains_encoded_value tests/test_apig_wsgi.py::TestV2Events::test_get tests/test_apig_wsgi.py::TestV2Events::test_get_missing_content_type tests/test_apig_wsgi.py::TestV2Events::test_cookie tests/test_apig_wsgi.py::TestV2Events::test_two_cookies tests/test_apig_wsgi.py::TestV2Events::test_mixed_cookies tests/test_apig_wsgi.py::TestV2Events::test_set_one_cookie tests/test_apig_wsgi.py::TestV2Events::test_set_two_cookies tests/test_apig_wsgi.py::TestV2Events::test_get_binary_support_default_text_content_types[text/plain] tests/test_apig_wsgi.py::TestV2Events::test_get_binary_support_default_text_content_types[text/html] tests/test_apig_wsgi.py::TestV2Events::test_get_binary_support_default_text_content_types[application/json] tests/test_apig_wsgi.py::TestV2Events::test_get_binary_support_default_text_content_types[application/vnd.api+json] tests/test_apig_wsgi.py::TestV2Events::test_get_binary_support_custom_text_content_types[test/custom] tests/test_apig_wsgi.py::TestV2Events::test_get_binary_support_custom_text_content_types[application/vnd.custom] tests/test_apig_wsgi.py::TestV2Events::test_get_binary_support_binary tests/test_apig_wsgi.py::TestV2Events::test_get_binary_support_binary_default_text_with_gzip_content_encoding[text/plain] tests/test_apig_wsgi.py::TestV2Events::test_get_binary_support_binary_default_text_with_gzip_content_encoding[text/html] tests/test_apig_wsgi.py::TestV2Events::test_get_binary_support_binary_default_text_with_gzip_content_encoding[application/json] tests/test_apig_wsgi.py::TestV2Events::test_get_binary_support_binary_default_text_with_gzip_content_encoding[application/vnd.api+json] tests/test_apig_wsgi.py::TestV2Events::test_get_binary_support_binary_custom_text_with_gzip_content_encoding[test/custom] tests/test_apig_wsgi.py::TestV2Events::test_get_binary_support_binary_custom_text_with_gzip_content_encoding[application/vnd.custom] tests/test_apig_wsgi.py::TestV2Events::test_plain_header tests/test_apig_wsgi.py::TestV2Events::test_special_headers tests/test_apig_wsgi.py::TestV2Events::test_path_unquoting tests/test_apig_wsgi.py::TestV2Events::test_empty_and_uncloseable_content tests/test_apig_wsgi.py::TestUnknownVersionEvents::test_errors