mirror of
https://github.com/openhab/openhab-addons.git
synced 2025-01-10 15:11:59 +01:00
[openuv] Correcting NPE in IconProvider (#15465)
Signed-off-by: Gaël L'hopital <gael@lhopital.org>
This commit is contained in:
parent
78381e8b6d
commit
e86998000e
@ -115,10 +115,14 @@ public class OpenUVIconProvider implements IconProvider {
|
||||
String result = "";
|
||||
|
||||
URL iconResource = context.getBundle().getEntry("icon/%s.svg".formatted(iconName));
|
||||
if (iconResource != null) {
|
||||
try (InputStream stream = iconResource.openStream()) {
|
||||
result = new String(stream.readAllBytes(), StandardCharsets.UTF_8);
|
||||
} catch (IOException e) {
|
||||
logger.warn("Unable to load ressource '{}' : {}", iconResource.getPath(), e.getMessage());
|
||||
logger.warn("Unable to load resource '{}': {}", iconResource.getPath(), e.getMessage());
|
||||
}
|
||||
} else {
|
||||
logger.warn("Unable to load icon named '{}'", iconName);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
@ -0,0 +1,30 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<svg version="1.2" width="52.876" height="26.86mm" viewBox="16361 7056 1399 2686" preserveAspectRatio="xMidYMid" fill-rule="evenodd" stroke-width="28.222" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg">
|
||||
<defs class="prefix__ClipPathGroup">
|
||||
<clipPath id="prefix__a" clipPathUnits="userSpaceOnUse">
|
||||
<path d="M 16351 7056 L 17750 7056 L 17750 9742 L 16351 9742 L 16351 7056 Z"/>
|
||||
</clipPath>
|
||||
<clipPath id="clip-1" clipPathUnits="userSpaceOnUse">
|
||||
<path d="M 16166.652 7055.968 L 17565.652 7055.968 L 17565.652 9741.968 L 16166.652 9741.968 L 16166.652 7055.968 Z"/>
|
||||
</clipPath>
|
||||
</defs>
|
||||
<path class="prefix__BoundingBox" fill="none" d="M16361 7056h1401v2687h-1401z" clip-path="url(#prefix__a)"/>
|
||||
<path fill="#143A79" d="M16568 7056h985c115 0 207 93 207 207v2272c0 114-92 207-207 207h-985c-115 0-207-93-207-207V7263c0-114 92-207 207-207z" clip-path="url(#prefix__a)"/>
|
||||
<path class="prefix__BoundingBox" fill="none" d="M16576 7201h460v551h-460z" clip-path="url(#prefix__a)"/>
|
||||
<path fill="#FFF" d="M16577 7562c0 113 101 189 229 189s229-76 229-189v-361h-98v352c0 75-57 115-131 115s-132-40-132-115v-352h-97v361z" clip-path="url(#prefix__a)"/>
|
||||
<path class="prefix__BoundingBox" fill="none" d="M17080 7201h502v546h-502z" clip-path="url(#prefix__a)"/>
|
||||
<path fill="#FFF" d="M17293 7746h76l212-545h-103l-146 415h-2l-147-415h-103l213 545z" clip-path="url(#prefix__a)"/>
|
||||
<path class="prefix__BoundingBox" fill="none" d="M16590 7807h33v217h-33z" clip-path="url(#prefix__a)"/>
|
||||
<path fill="#FFF" d="M16590 8023h32v-216h-32v216z" clip-path="url(#prefix__a)"/>
|
||||
<path class="prefix__BoundingBox" fill="none" d="M16709 7807h154v217h-154z" clip-path="url(#prefix__a)"/>
|
||||
<path fill="#FFF" d="M16709 8023h30v-153h1l93 153h29v-216h-31v154l-93-154h-29v216z" clip-path="url(#prefix__a)"/>
|
||||
<path class="prefix__BoundingBox" fill="none" d="M16948 7807h146v217h-146z" clip-path="url(#prefix__a)"/>
|
||||
<path fill="#FFF" d="M16948 8023h69c31 0 52-16 64-36 10-15 12-23 12-72 0-45-1-53-12-72-13-24-35-36-62-36h-71v216zm31-186h37c17 0 27 5 36 20 9 11 9 21 9 59 0 40 0 46-7 57-8 13-21 19-38 19h-37v-155z" clip-path="url(#prefix__a)"/>
|
||||
<path class="prefix__BoundingBox" fill="none" d="M17173 7807h132v217h-132z" clip-path="url(#prefix__a)"/>
|
||||
<path fill="#FFF" d="M17173 8023h131v-31h-100v-63h85v-29h-85v-63h100v-30h-131v216z" clip-path="url(#prefix__a)"/>
|
||||
<path class="prefix__BoundingBox" fill="none" d="M17352 7807h161v217h-161z" clip-path="url(#prefix__a)"/>
|
||||
<path fill="#FFF" d="M17477 8023h35l-64-111 60-105h-35l-42 75-40-75h-35l58 105-62 111h35l44-80 46 80z" clip-path="url(#prefix__a)"/>
|
||||
<path class="prefix__BoundingBox" fill="none" d="M16430 8115h364v1523h-364z" clip-path="url(#prefix__a)"/>
|
||||
<path class="prefix__BoundingBox" fill="none" d="M16901 8102h725v1548h-725z" clip-path="url(#prefix__a)"/>
|
||||
<path d="M 17247.653 9198.968 C 17247.653 9345.968 17175.653 9431.968 17068.653 9431.968 C 16961.653 9431.968 16889.653 9345.968 16889.653 9198.968 L 16889.653 8553.968 C 16889.653 8405.968 16961.653 8319.968 17068.653 8319.968 C 17175.653 8319.968 17247.653 8405.968 17247.653 8553.968 L 17247.653 9198.968 Z M 16706.653 9211.968 C 16706.653 9490.968 16880.653 9648.968 17068.653 9648.968 C 17256.653 9648.968 17429.653 9490.968 17429.653 9211.968 L 17429.653 8540.968 C 17429.653 8259.968 17256.653 8101.968 17068.653 8101.968 C 16880.653 8101.968 16706.653 8259.968 16706.653 8540.968 L 16706.653 9211.968 Z" clip-path="url(#clip-1)" style="fill: rgb(155, 195, 7);"/>
|
||||
</svg>
|
After Width: | Height: | Size: 3.5 KiB |
Loading…
Reference in New Issue
Block a user