RFR: JDK-8344907 : NullPointerException in Win32ShellFolder2.getSystemIcon when "icon" is null [v2]
Harshitha Onkar
honkar at openjdk.org
Mon Dec 23 20:31:13 UTC 2024
On Tue, 17 Dec 2024 14:16:53 GMT, Alexey Ivanov <aivanov at openjdk.org> wrote:
>> src/java.desktop/windows/classes/sun/awt/shell/Win32ShellFolder2.java line 1203:
>>
>>> 1201: */
>>> 1202: static Image getSystemIcon(SystemIcon iconType) {
>>> 1203: long hIcon = getSystemIcon(iconType.getIconID());
>>
>> What is hIcon value here? If it is 0 we can simply add the same condition as in the getShell32Icon and avoid all the makeIcon and disposeIcon calls. Or we have a valid hIcon code but makeIcon is unable to construct an icon for it?
>
> Yes, I think you should add the condition `if (hIcon != 0)` before calling `makeIcon(hIcon)`.
Updated
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/22776#discussion_r1896099961
More information about the client-libs-dev
mailing list