Fix exception when SVG icon name has no file extension

This commit is contained in:
poce1don
2026-01-24 20:44:50 -03:00
parent 465254c0da
commit 7fc26fe77e

View File

@@ -524,7 +524,8 @@ public class FlatSVGIcon
private URL getIconURL( String name, boolean dark ) { private URL getIconURL( String name, boolean dark ) {
if( dark ) { if( dark ) {
int dotIndex = name.lastIndexOf( '.' ); int dotIndex = name.lastIndexOf( '.' );
name = name.substring( 0, dotIndex ) + "_dark" + name.substring( dotIndex ); if ( dotIndex > 0 )
name = name.substring( 0, dotIndex ) + "_dark" + name.substring( dotIndex );
} }
ClassLoader cl = (classLoader != null) ? classLoader : FlatSVGIcon.class.getClassLoader(); ClassLoader cl = (classLoader != null) ? classLoader : FlatSVGIcon.class.getClassLoader();