Skip to content

Conversation

plata
Copy link
Collaborator

@plata plata commented Aug 26, 2017

var setupWizard = SetupWizard(this._name);
var appsManager = Bean("repositoryManager");
var application = appsManager.getApplication([this._type, this._category, this._name]);
var setupWizard = SetupWizardWithMiniature(this._name, application.getMainMiniature().get());
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think calling get() is dangerous here. We can't be sure, that a script provides a main miniature. If this is not the case this line will throw an exception.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It's not true. I've just tried it. The only thing that happens is that the default miniature is used.

Copy link
Collaborator

Choose a reason for hiding this comment

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

This makes no sense.
If no main miniature exists for an application Optional.empty() is returned.
If you call get() on Optional.empty, then new NoSuchElementException("No value present") will be thrown.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Now I have it. Don't know. Must have done something wrong.

@plata plata merged commit 36abce0 into PhoenicisOrg:master Aug 26, 2017
@plata plata deleted the installation-miniature branch August 26, 2017 16:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants