On Fri, 11 Nov 2022 08:18:19 GMT, Tejesh R <[email protected]> wrote:

> Observation found when JFileChooser is instantiated in WindowsLookAndFeel 
> which invokes getSystemIcon() from WindowsFileChooserUI class. Could not find 
> the exact root cause so predicting it to be an issue with icons not loaded 
> where resolutionVariants map is empty in _public Image 
> getResolutionVariant(double width, double height) _. Hence proposing a null 
> check before accessing getWidth(). Fix is tested in CI system.

Can you verify that the MultiResolutionImage contains no variants?

If it's the case, a cleaner way would be to return `null` right away.

Or rather, the function that creates the `MultiResolutionIconImage` instance 
should be modified to return `null` rather than returning an MRI with no 
variants. This should never happen because if the system does not provide an 
icon, a default icon gets requested.

By adding the null-check we don't resolve the real problem but pretend it does 
not exist.

-------------

PR: https://git.openjdk.org/jdk/pull/11104

Reply via email to