Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make preference node renderers more robust against null values #11074

Conversation

colin-grant-work
Copy link
Contributor

What it does

A number of preferences use null as a default even if that is not among their declared values. As a consequence, it is possible for a preference renderer to encounter a null value when another value type is expected.

How to test

  1. Start the application.
  2. Open the preferences UI
  3. On master, you will see a message about inability to read toString of null and the layout may fail to be restored.
  4. With this code, you will see no message about inability to read toString of null and the layout should successfully be restored. The preference html.format.maxPreserveNewLines should show an empty input box, unless you have set a numerical value for it.

Review checklist

Reminder for reviewers

@colin-grant-work colin-grant-work added the preferences issues related to preferences label Apr 25, 2022
Copy link
Member

@vince-fugnitto vince-fugnitto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I confirmed that the changes work well 👍

The error on master is no longer present, and input fields such as html.format.maxPreserveNewLines now properly render by default (null value).

@colin-grant-work colin-grant-work merged commit f527fb3 into eclipse-theia:master Apr 26, 2022
@colin-grant-work colin-grant-work deleted the bugfix/preferences-and-null branch April 26, 2022 13:18
@colin-grant-work colin-grant-work added this to the 1.25.0 milestone Apr 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
preferences issues related to preferences
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants