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

pass empty string instead of null to prevent NPE #3563

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public ConfigurationStore(String identifier, Client client, IPreferenceStore pre
// make one active (and there always must be one active)
this.active = configSet.lookup(preferences.getString(identifier + KEY_ACTIVE))
.orElseGet(() -> configSet.getConfigurations().findFirst().orElseGet(() -> {
Configuration defaultConfig = new Configuration(Messages.ConfigurationStandard, null);
Configuration defaultConfig = new Configuration(Messages.ConfigurationStandard, ""); //$NON-NLS-1$
configSet.add(defaultConfig);
return defaultConfig;
}));
Expand Down Expand Up @@ -202,7 +202,7 @@ private void delete(Configuration config)

listeners.forEach(ConfigurationStoreOwner::beforeConfigurationPicked);
active = configSet.getConfigurations().findAny().orElseGet(() -> {
Configuration defaultConfig = new Configuration(Messages.ConfigurationStandard, null);
Configuration defaultConfig = new Configuration(Messages.ConfigurationStandard, ""); //$NON-NLS-1$
configSet.add(defaultConfig);
return defaultConfig;
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public ChartConfig(WidgetDelegate<?> delegate, DataSeries.UseCase useCase)
configSet = delegate.getClient().getSettings().getConfigurationSet(configName);
String uuid = delegate.getWidget().getConfiguration().get(Dashboard.Config.CONFIG_UUID.name());
config = configSet.lookup(uuid).orElseGet(() -> configSet.getConfigurations().findFirst()
.orElseGet(() -> new ConfigurationSet.Configuration(Messages.LabelNoName, null)));
.orElseGet(() -> new ConfigurationSet.Configuration(Messages.LabelNoName, ""))); //$NON-NLS-1$

addConfig(new ChartShowYAxisConfig(delegate, false));
}
Expand Down