Repository: slackapi/python-slackclient (python)

Issue:
WebClient's paginated API calls may fail with no params (v2.6.0+)
### Description

Since version 2.6.0, `WebClient` w/ `run_async=False` may fail during paginated API calls only when the call doesn't have any params.

```python
from slack import WebClient
client = WebClient(token="xoxb-***")
all = []
for page in client.conversations_list():
    all = all + page["channels"] # only when there are 100+ channels in the workspace
```

```
  File "/path-to-project/env/lib/python3.8/site-packages/slack/web/slack_response.py", line 134, in __next__
    self.req_args.get("params", {}).update(
AttributeError: 'NoneType' object has no attribute 'update'
```

### What type of issue is this? (place an `x` in one of the `[ ]`)
- [x] bug
- [ ] enhancement (feature request)
- [ ] question
- [ ] documentation related
- [ ] testing related
- [ ] discussion

### Requirements (place an `x` in each of the `[ ]`)
* [x] I've read and understood the [Contributing guidelines](https://github.com/slackapi/python-slackclient/blob/master/.github/contributing.md) and have done my best effort to follow them.
* [x] I've read and agree to the [Code of Conduct](https://slackhq.github.io/code-of-conduct).
* [x] I've searched for any related issues and avoided creating a duplicate issue.

---

### Bug Report

#### Reproducible in:

* slackclient version: v2.6.0+
* python version: any
* OS version(s): any

#### Steps to reproduce:

```python
from slack import WebClient
client = WebClient(token="xoxb-***")
all = []
for page in client.conversations_list():
    all = all + page["channels"] # only when there are 100+ channels in the workspace
```

```
  File "/path-to-project/env/lib/python3.8/site-packages/slack/web/slack_response.py", line 134, in __next__
    self.req_args.get("params", {}).update(
AttributeError: 'NoneType' object has no attribute 'update'
```

#### Expected result:

Successful pagination.

#### Actual result:

`WebClient` raises an error when fetching the second page.


Pull request:
Fix #705 by modifying SlackResponse to consider None value in dict
###  Summary

This pull request fixes #705 by modifying `SlackRepsonse` to consider possible None values in `req_args` dict.

### Requirements (place an `x` in each `[ ]`)

* [x] I've read and understood the [Contributing Guidelines](https://github.com/slackapi/python-slackclient/blob/master/.github/contributing.md) and have done my best effort to follow them.
* [x] I've read and agree to the [Code of Conduct](https://slackhq.github.io/code-of-conduct).

Patch:
diff --git a/slack/web/slack_response.py b/slack/web/slack_response.py
index 3ee3b3e..42837ff 100644
--- a/slack/web/slack_response.py
+++ b/slack/web/slack_response.py
@@ -131,9 +131,11 @@ class SlackResponse(object):
         if self._iteration == 1:
             return self
         if self._next_cursor_is_present(self.data):
-            self.req_args.get("params", {}).update(
-                {"cursor": self.data["response_metadata"]["next_cursor"]}
-            )
+            params = self.req_args.get("params", {})
+            if params is None:
+                params = {}
+            params.update({"cursor": self.data["response_metadata"]["next_cursor"]})
+            self.req_args.update({"params": params})
 
             if self._use_sync_aiohttp:
                 # We no longer recommend going with this way


Test patch:
diff --git a/tests/web/test_web_client.py b/tests/web/test_web_client.py
index f813732..475d30c 100644
--- a/tests/web/test_web_client.py
+++ b/tests/web/test_web_client.py
@@ -177,3 +177,10 @@ class TestWebClient(unittest.TestCase):
         self.assertIsNone(resp["error"])
         with self.assertRaises(err.SlackApiError):
             await self.async_client.oauth_access(client_id="999.999", client_secret="secret", code="codeeeeeeeeee")
+
+    def test_issue_705_no_param_request_pagination(self):
+        self.client.token = "xoxb-users_list_pagination"
+        users = []
+        for page in self.client.users_list():
+            users = users + page["members"]
+        self.assertTrue(len(users) == 4)