1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-12-29 03:55:49 +01:00

Bangle.js: Fix null pointer issue if headers not supplied for HTTP request

This commit is contained in:
Gordon Williams 2022-08-24 20:26:25 +01:00
parent 02dca611b0
commit 0f052f5467

View File

@ -629,11 +629,13 @@ public class BangleJSDeviceSupport extends AbstractBTLEDeviceSupport {
@Override
public Map<String, String> getHeaders() throws AuthFailureError {
Map<String, String> h = super.getHeaders();
Iterator<String> iter = headers.keySet().iterator();
while (iter.hasNext()) {
String key = iter.next();
String value = headers.get(key);
h.put(key, value);
if (headers != null) {
Iterator<String> iter = headers.keySet().iterator();
while (iter.hasNext()) {
String key = iter.next();
String value = headers.get(key);
h.put(key, value);
}
}
return h;
}