Revision 177

View differences:

org.gvsig.educa.thematicmap.app/trunk/org.gvsig.educa.thematicmap.app/org.gvsig.educa.thematicmap.app.editor/src/main/java/org/gvsig/educa/thematicmap/app/editor/OpenRelatedDocumentExtension.java
85 85
     * @return
86 86
     */
87 87
    private Document getRelatedDocument(IWindow window) {
88
        if (editorManager == null) {
89
            // initialization process not finished yet
90
            return null;
91
        }
88 92
        if (window instanceof IView) {
89 93
            return editorManager.getThematicMapDocumentByView(((IView) window)
90 94
                .getViewDocument());
org.gvsig.educa.thematicmap.app/trunk/org.gvsig.educa.thematicmap.app/org.gvsig.educa.thematicmap.app.editor/src/main/java/org/gvsig/educa/thematicmap/app/editor/RegenerateThematicMapExtension.java
77 77
    public boolean isEnabled() {
78 78
        IWindow window = PluginServices.getMDIManager().getActiveWindow();
79 79
        ThematicMapDocument thMap = getRelatedThematicMap(window);
80
        return thMap.getSourceView() != null;
80
        return thMap != null && thMap.getSourceView() != null;
81 81
    }
82 82

  
83 83
    /** {@inheridDoc} */
......
97 97
     * @return
98 98
     */
99 99
    private ThematicMapDocument getRelatedThematicMap(IWindow window) {
100
        if (editorManager == null) {
101
            // initialization process not finished yet
102
            return null;
103
        }
100 104
        if (window instanceof IView) {
101 105
            return editorManager.getThematicMapDocumentByView(((IView) window)
102 106
                .getViewDocument());

Also available in: Unified diff