nextcloud / talk-ios

📱😀 Video & audio calls through Nextcloud on iOS
GNU General Public License v3.0
146 stars 88 forks source link

Fix crash when 422 on join is returned #1736

Closed SystemKeeper closed 1 month ago

SystemKeeper commented 1 month ago

When we receive a 422 - Unprocessable entity error (so the remote could not be reached), ocs.data is an empty array instead of nil, which is why we crash here. So we need to make sure we got a dictionary, before accessing any keys.

Ref https://github.com/nextcloud/spreed/blob/df923967fa31f9abe1c674f43b2ed88f3064415b/lib/Middleware/InjectionMiddleware.php#L411-L417