Skip to content

Commit aa5094a

Browse files
committed
copilot review
Signed-off-by: Mark Herwege <mark.herwege@telenet.be>
1 parent 6170295 commit aa5094a

2 files changed

Lines changed: 6 additions & 4 deletions

File tree

bundles/org.openhab.core.sitemap/src/main/java/org/openhab/core/sitemap/internal/registry/SitemapFactoryImpl.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,10 @@
4545
import org.openhab.core.sitemap.internal.VideoImpl;
4646
import org.openhab.core.sitemap.internal.WebviewImpl;
4747
import org.openhab.core.sitemap.registry.SitemapFactory;
48-
import org.openhab.core.sitemap.registry.SitemapRegistry;
4948
import org.osgi.service.component.annotations.Component;
5049

5150
/**
52-
* The {@link SitemapFactoryImpl} implements the {@link SitemapRegistry}
51+
* The {@link SitemapFactoryImpl} implements the {@link SitemapFactory}
5352
*
5453
* @author Mark Herwege - Initial contribution
5554
*/

bundles/org.openhab.core.ui/src/main/java/org/openhab/core/ui/internal/proxy/ProxyServletService.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ URI uriFromRequest(HttpServletRequest request) {
258258
}
259259

260260
try {
261-
uri = createURIFromString(uriString != null ? uriString : "");
261+
uri = createURIFromString(uriString);
262262
request.setAttribute(ATTR_URI, uri);
263263
return uri;
264264
} catch (MalformedURLException | URISyntaxException ex) {
@@ -275,7 +275,10 @@ URI uriFromRequest(HttpServletRequest request) {
275275
return sitemapRegistry.get(sitemapName);
276276
}
277277

278-
private URI createURIFromString(String url) throws MalformedURLException, URISyntaxException {
278+
private URI createURIFromString(@Nullable String url) throws MalformedURLException, URISyntaxException {
279+
if (url == null) {
280+
throw new MalformedURLException();
281+
}
279282
URI uri = new URI(url);
280283
// URI in this context should be valid URL. Therefore before returning URI, create URL,
281284
// which validates the string.

0 commit comments

Comments
 (0)