mirror of
https://github.com/openhab/openhab-addons.git
synced 2025-01-10 15:11:59 +01:00
Fix null pointer exception for invalid protocolInfo. (#12632)
Signed-off-by: Mark Herwege <mark.herwege@telenet.be>
This commit is contained in:
parent
aefdf06db0
commit
3123810b98
@ -28,9 +28,12 @@ public class UpnpEntryRes {
|
||||
private String importUri;
|
||||
private String res = "";
|
||||
|
||||
public UpnpEntryRes(String protocolInfo, @Nullable Long size, @Nullable String duration,
|
||||
public UpnpEntryRes(@Nullable String protocolInfo, @Nullable Long size, @Nullable String duration,
|
||||
@Nullable String importUri) {
|
||||
this.protocolInfo = protocolInfo.trim();
|
||||
// According to the UPnP standard, res should always contain protocolInfo. Some devices do not respect this
|
||||
// standard in their AVTransport implementation. To avoid null pointer exceptions, take care of this special
|
||||
// case.
|
||||
this.protocolInfo = (protocolInfo == null) ? "*" : protocolInfo.trim();
|
||||
this.size = size;
|
||||
this.duration = (duration == null) ? "" : duration.trim();
|
||||
this.importUri = (importUri == null) ? "" : importUri.trim();
|
||||
|
Loading…
Reference in New Issue
Block a user