Browse Source

Icons: Ensure loaded svg document isn't null

jsvg
Jannis Weis 3 years ago
parent
commit
ca848ea348
No known key found for this signature in database
GPG Key ID: 7C9D8D4B558049AB
  1. 2
      property-loader/src/main/java/com/github/weisj/darklaf/properties/icons/DarkSVGIcon.java

2
property-loader/src/main/java/com/github/weisj/darklaf/properties/icons/DarkSVGIcon.java

@ -26,6 +26,7 @@ import java.awt.image.BufferedImage;
import java.io.Serializable;
import java.net.MalformedURLException;
import java.net.URI;
import java.util.Objects;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.logging.Level;
import java.util.logging.Logger;
@ -147,6 +148,7 @@ public class DarkSVGIcon
} catch (MalformedURLException e) {
LOGGER.log(Level.SEVERE, e.getMessage(), e);
}
Objects.requireNonNull(svgDocument, () -> "Document failed to load: " + iconUri.toASCIIString());
loaded.set(true);
return true;
}

Loading…
Cancel
Save