Skip to content

Commit

Permalink
check for null point exception
Browse files Browse the repository at this point in the history
  • Loading branch information
yuanho committed Oct 1, 2024
1 parent a44b04e commit aeae0a1
Showing 1 changed file with 22 additions and 20 deletions.
42 changes: 22 additions & 20 deletions src/ucar/unidata/idv/control/CrossSectionControl.java
Original file line number Diff line number Diff line change
Expand Up @@ -1648,7 +1648,7 @@ public void crossSectionChanged() {
CrossSectionSelector cs = getCrossSectionSelector();
doShare(SHARE_XSLINE, new Object[] { cs.getStartPoint(),
cs.getEndPoint() });
if(controlList.size() >=1){
if(controlList != null && controlList.size() >=1){
for(CrossSectionControl csc: controlList.values()){
csc.csSelector = csSelector;
csc.loadDataFromLine();
Expand Down Expand Up @@ -1890,24 +1890,26 @@ protected void loadDataFromLine() throws VisADException, RemoteException {
}

GridDataInstance gdi = getGridDataInstance();
FieldImpl slice = gdi.sliceAlongLatLonLine(
points,
getSamplingModeValue(
getObjectStore().get(PREF_SAMPLING_MODE,
DEFAULT_SAMPLING_MODE)));
// apply smoothing
if (checkFlag(FLAG_SMOOTHING)
&& !getSmoothingType().equals(LABEL_NONE)) {
slice = GridUtil.smooth(slice, getSmoothingType(),
getSmoothingFactor());
}
// apply skip factor
if (getSkipValue() > 0) {
slice = GridUtil.subset(slice, getSkipValue() + 1, 1);
}
showWaitCursor();
loadData(slice);
showNormalCursor();
if(gdi != null) {
FieldImpl slice = gdi.sliceAlongLatLonLine(
points,
getSamplingModeValue(
getObjectStore().get(PREF_SAMPLING_MODE,
DEFAULT_SAMPLING_MODE)));
// apply smoothing
if (checkFlag(FLAG_SMOOTHING)
&& !getSmoothingType().equals(LABEL_NONE)) {
slice = GridUtil.smooth(slice, getSmoothingType(),
getSmoothingFactor());
}
// apply skip factor
if (getSkipValue() > 0) {
slice = GridUtil.subset(slice, getSkipValue() + 1, 1);
}
showWaitCursor();
loadData(slice);
showNormalCursor();
}
}


Expand Down Expand Up @@ -2882,7 +2884,7 @@ public void processNewDataV(List newChoices)
myFlowCrossSectionControl.paramName = dc.getName();
myFlowCrossSectionControl.crossSectionView = crossSectionView;
myFlowCrossSectionControl.init(dc, csSelector);
myFlowCrossSectionControl.initDone();
//myFlowCrossSectionControl.initDone();

addDisplayable(myFlowCrossSectionControl.xsDisplay);
addDisplayable(myFlowCrossSectionControl.vcsDisplay, crossSectionView);
Expand Down

0 comments on commit aeae0a1

Please sign in to comment.