Revision 47728 trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.app/org.gvsig.app.mainplugin/src/main/java/org/gvsig/app/project/documents/view/dynformfield/linkforeingkeywgs/JDynFormFieldForeingKeyWGS.java
JDynFormFieldForeingKeyWGS.java | ||
---|---|---|
779 | 779 |
} |
780 | 780 |
|
781 | 781 |
private Pair<MapControl, FLyrVect> findMapControl(FeatureStore store) { |
782 |
if (store == null) { |
|
783 |
return null; |
|
784 |
} |
|
782 | 785 |
ApplicationManager application = ApplicationLocator.getApplicationManager(); |
783 | 786 |
IView view = (IView) application.getActiveComponent(ViewDocument.class); |
784 | 787 |
if (view == null) { |
785 | 788 |
return null; |
786 | 789 |
} |
787 | 790 |
DataStoreParameters storeParams = store.getParameters(); |
791 |
if (storeParams == null) { |
|
792 |
return null; |
|
793 |
} |
|
788 | 794 |
MapControl theMapControl = view.getMapControl(); |
789 | 795 |
MapContext mapContext = theMapControl.getMapContext(); |
790 | 796 |
for (FLayer layer : mapContext.getLayers().deepiterable()) { |
791 | 797 |
if (layer instanceof FLyrVect) { |
792 | 798 |
FeatureStore layerStore = ((FLyrVect) layer).getFeatureStore(); |
793 |
if (layerStore.getParameters().isTheSameStore(storeParams)) { |
|
799 |
if (layerStore!=null && layerStore.getParameters().isTheSameStore(storeParams)) {
|
|
794 | 800 |
return new ImmutablePair<>(theMapControl, ((FLyrVect) layer)); |
795 | 801 |
} |
796 | 802 |
} |
Also available in: Unified diff