fix for empty list of profiles

git-svn-id: http://svn.d4science-ii.research-infrastructures.eu/gcube/trunk/portlets/widgets/ckan-metadata-publisher-widget@130662 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Costantino Perciante 2016-07-21 17:31:05 +00:00
parent eabefd3db0
commit 3b3bc51224
2 changed files with 2 additions and 2 deletions

View File

@ -1072,7 +1072,7 @@ public class CreateDatasetForm extends Composite{
* @return
*/
private boolean checkSelectedMetaDataProfile() {
return metadataProfilesFormatListbox.getSelectedItemText().equals("none");
return metadataProfilesFormatListbox.getSelectedItemText().equals("none") && (metadataProfilesFormatListbox.getItemCount() == 1);
}
/**

View File

@ -546,7 +546,7 @@ public class CKANPublisherServicesImpl extends RemoteServiceServlet implements C
@Override
public List<MetaDataProfileBean> getProfiles(String orgName) {
List<MetaDataProfileBean> toReturn = null;
List<MetaDataProfileBean> toReturn = new ArrayList<MetaDataProfileBean>();
try{
toReturn = Utils.getMetadataProfilesList(Utils.retrieveScopeFromOrganizationName(orgName), getThreadLocalRequest().getSession(), getASLSession(), CKAN_PROFILES_KEY);
}catch(Exception e){