Project

General

Profile

« Previous | Next » 

Revision 4bf09483

Added by Patrick Plitzner over 4 years ago

fix #7290 Fix NPE when view has not already been created

View differences:

eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/e4/TaxonNavigatorE4.java
192 192

  
193 193
    protected void updateSyncButton() {
194 194
        MPart viewPart = partService.findPart(AppModelId.PARTDESCRIPTOR_EU_ETAXONOMY_TAXEDITOR_NAVIGATION_NAVIGATOR);
195
        if(viewPart!=null){
196
            MToolBar toolBar = viewPart.getToolbar();
195 197

  
196
        MToolBar toolBar = viewPart.getToolbar();
198
            List<MToolBarElement> toolBarElements = toolBar.getChildren();
197 199

  
198
        List<MToolBarElement> toolBarElements = toolBar.getChildren();
199

  
200

  
201
        MToolBarElement upperHandledMenuItem = toolBarElements.get(1);
202
        if (upperHandledMenuItem instanceof HandledToolItemImpl){
203
            ((HandledToolItemImpl)upperHandledMenuItem).setSelected(linkWithTaxon);
200
            MToolBarElement upperHandledMenuItem = toolBarElements.get(1);
201
            if (upperHandledMenuItem instanceof HandledToolItemImpl){
202
                ((HandledToolItemImpl)upperHandledMenuItem).setSelected(linkWithTaxon);
203
            }
204 204
        }
205 205
    }
206 206

  
......
458 458
	public void update(Observable o, Object arg) {
459 459
		if(o instanceof LoginManager){
460 460
			refresh();
461
			updateSyncButton();
462 461
		}
463 462

  
464 463
	}
......
502 501
                viewer.refresh();
503 502
            }
504 503
        }
505
        updateSyncButton();
506 504
    }
507 505

  
508 506
    @Override

Also available in: Unified diff