JsonAddonService: Fix warning on startup (#4602)

When starting openHAB, I always get the following warning:

```
14:44:47.082 [WARN ] [tplace.internal.json.JsonAddonService] - JSON Addon Service invalid URL:
```

We should avoid this warning, I don't see a problem there, and we should not confuse users with unnecessary warnings.

Signed-off-by: Florian Hotze <dev@florianhotze.com>
This commit is contained in:
Florian Hotze
2025-02-16 15:52:39 +01:00
committed by GitHub
parent b90e87367d
commit e41db78804
@@ -101,6 +101,9 @@ public class JsonAddonService extends AbstractRemoteAddonService {
} }
private boolean isValidUrl(String urlString) { private boolean isValidUrl(String urlString) {
if (urlString.isBlank()) {
return false;
}
try { try {
(new URI(urlString)).toURL(); (new URI(urlString)).toURL();
} catch (IllegalArgumentException | URISyntaxException | MalformedURLException e) { } catch (IllegalArgumentException | URISyntaxException | MalformedURLException e) {