if (_myindex == null) {
if (_selection == null) { // Opening a study just newed
_selection = _openStudy.getSelection(); // Default selection
- }
- // Re-opening (refreshing) the currently open study
- _openStudy = open(getStudyService().selectStudy(
- _openStudy.getIndex())); // Closes the previously open study
- _openStudy.setSelection(_selection);
+ }
+ if(_openStudy.getStudyObject() == null) {
+ // Nothing to open or re-open
+ res = ERROR;
+ } else {
+ // Re-opening (refreshing) the currently open study
+ _openStudy = open(getStudyService().selectStudy(
+ _openStudy.getIndex())); // Closes the previously open study
+ _openStudy.setSelection(_selection);
+ }
} else {
try { // Opening a study from the search result
int index = Integer.valueOf(_myindex);