On Tue, 5 Dec 2023 13:02:36 GMT, Alexey Ivanov <[email protected]> wrote:
> if the URL is invalid, the image isn't loaded
if (!loadedImage) {
URL url = CSS.getURL(base, svalue);
if (url != null) {
image = new ImageIcon();
Image tmpImg =
Toolkit.getDefaultToolkit().createImage(url);
if (tmpImg != null) {
image.setImage(tmpImg);
}
}
loadedImage = true;
}
As per your change, if URL is invalid ie url = null, image is not loaded but
`loadedImage` is set to true so it will not give another chance to load the URL
again via `CSS.getURL` just in case user decides to call setBase with a valid
URL (after finding `getImage `returning null)
-------------
PR Comment: https://git.openjdk.org/jdk/pull/16917#issuecomment-1840794783