Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add null check to cope with missing Content-Type header #3

Merged
merged 1 commit into from
Dec 8, 2024

Conversation

sbholmes
Copy link

@sbholmes sbholmes commented Nov 1, 2024

I started getting NPEs when adding my Sony TV, although it had been working fine previously - not sure what changed. The below null check fixes it.

As you can see from these logs, it's the call to get the file sony/ircc/IRCCSCPD.xml that results in a response with no Content-Type header.

2024-11-02 00:21:40.754 [INFO ] [g.sony.internal.AbstractThingHandler] - Thing initialization is called, trying to connect...
2024-11-02 00:21:40.914 [INFO ] [inding.sony.internal.net.HttpRequest] - request for http://TV_IP:37774/sony/webapi/ssdp/dd.xml, response headers {accept-range=[none], connection=[close], content=[text/xml; charset=utf-8], Content-Length=[5534], date=[Fri, 01 Nov 2024 11:21:12 GMT], server=[FedoraCore/2 UPnP/1.0 MINT-X/1.8.1], Content-Type=[text/xml; charset="utf-8"]}
2024-11-02 00:21:41.636 [INFO ] [inding.sony.internal.net.HttpRequest] - request for http://172.23.50.37:37774/sony/webapi/ssdp/dd.xml, response headers {accept-range=[none], connection=[close], content=[text/xml; charset=utf-8], Content-Length=[5534], date=[Fri, 01 Nov 2024 11:21:13 GMT], server=[FedoraCore/2 UPnP/1.0 MINT-X/1.8.1], Content-Type=[text/xml; charset="utf-8"]}
2024-11-02 00:21:41.702 [INFO ] [inding.sony.internal.net.HttpRequest] - request for http://TV_IP:37774/sony/webapi/ssdp/scpd/WebApiSCPD.xml, response headers {accept-range=[none], connection=[close], content=[text/xml; charset=utf-8], Content-Length=[323], date=[Fri, 01 Nov 2024 11:21:13 GMT], last-modified=[Tue, 29 Oct 2024 23:08:28 GMT], server=[FedoraCore/2 UPnP/1.0 MINT-X/1.8.1], Content-Type=[text/xml; charset="utf-8"]}
2024-11-02 00:21:41.759 [INFO ] [inding.sony.internal.net.HttpRequest] - request for http://TV_IP/sony/ircc/IRCCSCPD.xml, response headers {connection=[keep-alive], transfer-encoding=[chunked]}
2024-11-02 00:21:42.321 [INFO ] [inding.sony.internal.net.HttpRequest] - request for http://TV_IP:37774/sony/webapi/ssdp/dd.xml, response headers {accept-range=[none], connection=[close], content=[text/xml; charset=utf-8], Content-Length=[5534], date=[Fri, 01 Nov 2024 11:21:13 GMT], server=[FedoraCore/2 UPnP/1.0 MINT-X/1.8.1], Content-Type=[text/xml; charset="utf-8"]}
2024-11-02 00:21:42.334 [INFO ] [inding.sony.internal.net.HttpRequest] - request for http://TV_IP:37774/sony/webapi/ssdp/scpd/WebApiSCPD.xml, response headers {accept-range=[none], connection=[close], content=[text/xml; charset=utf-8], Content-Length=[323], date=[Fri, 01 Nov 2024 11:21:13 GMT], last-modified=[Tue, 29 Oct 2024 23:08:28 GMT], server=[FedoraCore/2 UPnP/1.0 MINT-X/1.8.1], Content-Type=[text/xml; charset="utf-8"]}
2024-11-02 00:21:42.350 [INFO ] [inding.sony.internal.net.HttpRequest] - request for http://TV_IP/sony/ircc/IRCCSCPD.xml, response headers {connection=[keep-alive], transfer-encoding=[chunked]}
2024-11-02 00:21:46.782 [INFO ] [g.sony.internal.AbstractThingHandler] - Starting state polling every 30 seconds

@andan67 andan67 merged commit f71ebd4 into andan67:feature/sony-4.2 Dec 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants