fix: Allow null values in json

This commit is contained in:
Christian Pauly 2020-11-12 06:40:10 +00:00
parent 1e14cd3ff0
commit c8d5bbfd14
1 changed files with 0 additions and 1 deletions

View File

@ -138,7 +138,6 @@ class MatrixApi {
} }
timeout ??= (_timeoutFactor * syncTimeoutSec) + 5; timeout ??= (_timeoutFactor * syncTimeoutSec) + 5;
dynamic json; dynamic json;
if (data is Map) data.removeWhere((k, v) => v == null);
(!(data is String)) ? json = jsonEncode(data) : json = data; (!(data is String)) ? json = jsonEncode(data) : json = data;
if (data is List<int> || action.startsWith('/media/r0/upload')) json = data; if (data is List<int> || action.startsWith('/media/r0/upload')) json = data;