Project

General

Profile

« Previous | Next » 

Revision 06a6a1c5

Added by Patrick Plitzner over 6 years ago

ref #7086, #7095 Fix potential class cast exception

View differences:

eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/workingSet/handler/DeleteWorkingSetHandler.java
21 21
	        @Named(IServiceConstants.ACTIVE_PART)MPart activePart) {
22 22
	    boolean confirm = MessagingUtils.confirmDialog("Confirm delete", "Do you really want to delete the working set?");
23 23
	    if(confirm && selection instanceof UuidAndTitleCache){
24
	        IWorkingSetService workingSetService = CdmStore.getService(IWorkingSetService.class);
25
	        workingSetService.delete(((UuidAndTitleCache) selection).getUuid());
26
	        WorkingSetNavigator navigator = (WorkingSetNavigator) activePart.getObject();
27
	        navigator.removeWorkingSet((UuidAndTitleCache<WorkingSet>) selection);
28
	        navigator.getConversationHolder().commit();
24
	        Object object = activePart.getObject();
25
	        if(object instanceof WorkingSetNavigator){
26
	            IWorkingSetService workingSetService = CdmStore.getService(IWorkingSetService.class);
27
	            workingSetService.delete(((UuidAndTitleCache) selection).getUuid());
28
	            WorkingSetNavigator navigator = (WorkingSetNavigator) object;
29
	            navigator.removeWorkingSet((UuidAndTitleCache<WorkingSet>) selection);
30
	            navigator.getConversationHolder().commit();
31
	        }
32
	        else{
33
	            MessagingUtils.error(DeleteWorkingSetHandler.class, "Deletion failed. Please try again", null);
34
	        }
29 35
	    }
30 36
	}
31 37

  

Also available in: Unified diff