Skip to content

Commit e41db78

Browse files
authored
JsonAddonService: Fix warning on startup (openhab#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 <[email protected]>
1 parent b90e873 commit e41db78

File tree

1 file changed

+3
-0
lines changed
  • bundles/org.openhab.core.addon.marketplace/src/main/java/org/openhab/core/addon/marketplace/internal/json

1 file changed

+3
-0
lines changed

bundles/org.openhab.core.addon.marketplace/src/main/java/org/openhab/core/addon/marketplace/internal/json/JsonAddonService.java

+3
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,9 @@ public void modified(@Nullable Map<String, Object> config) {
101101
}
102102

103103
private boolean isValidUrl(String urlString) {
104+
if (urlString.isBlank()) {
105+
return false;
106+
}
104107
try {
105108
(new URI(urlString)).toURL();
106109
} catch (IllegalArgumentException | URISyntaxException | MalformedURLException e) {

0 commit comments

Comments
 (0)