Skip to content

Commit

Permalink
webadmin: Fix template import
Browse files Browse the repository at this point in the history
The import of the template failed because one
of the provided listeners on cluster changes
was null. The listener was used to load OS into
a list for the VM, however, it is not needed
for the templates. This patch adds a check and
does not add the listener if it is null (as is
the case for the templates).

Bug-Url: https://bugzilla.redhat.com/2104597
  • Loading branch information
ljelinkova authored and ahadas committed Jul 20, 2022
1 parent dfe2c4b commit f6efaa4
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,9 @@ protected void doInit() {
}
getClusterQuota().setIsAvailable(dataCenter.getQuotaEnforcementType() != QuotaEnforcementTypeEnum.DISABLED);
getCluster().getSelectedItemChangedEvent().addListener(clusterChangedListener);
getCluster().getSelectedItemChangedEvent().addListener(vmImportGeneralModel);
if (vmImportGeneralModel != null) {
getCluster().getSelectedItemChangedEvent().addListener(vmImportGeneralModel);
}
// get cluster
getCluster().setItems(null);
AsyncDataProvider.getInstance().getClusterByServiceList(new AsyncQuery<>(clusters -> {
Expand Down

0 comments on commit f6efaa4

Please sign in to comment.