RFR: 8339068: [Linux] NPE: Cannot read field "firstFont" because "<local4>" is null
John Hendrikx
jhendrikx at openjdk.org
Tue Aug 27 18:16:11 UTC 2024
On Tue, 27 Aug 2024 15:50:54 GMT, Jose Pereda <jpereda at openjdk.org> wrote:
> Shouldn't we fail gracefully after LogicalFont::getSlot0Resource if slot0FontResource is finally null?
It calls `PrismFontFactory::getDefaultFontResource` -- this function looks practically everywhere to find some kind of font. I think if it fails, JavaFX should just not start up at all (unless using FX without fonts is a "supported" configuration). Having no font at all will no doubt lead to all kinds of problems later on, so whether supported or not, we'd need checks everywhere then to ensure code can handle having no fonts.
If you think that there still is a font, then perhaps `PrismFontFactory::getDefaultFontResource` should return that.
-------------
PR Comment: https://git.openjdk.org/jfx/pull/1546#issuecomment-2313216418
More information about the openjfx-dev
mailing list