Skip to content

Commit

Permalink
Check for nullGenome on startup failure
Browse files Browse the repository at this point in the history
  • Loading branch information
jrobinso committed Sep 2, 2024
1 parent bbc7989 commit 68d16cf
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 6 additions & 2 deletions src/main/java/org/broad/igv/feature/genome/GenomeManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -234,15 +234,19 @@ public void setCurrentGenome(String genomePath, Genome newGenome) {
if (IGV.hasInstance()) {
IGV.getInstance().goToLocus(newGenome.getHomeChromosome()); // newGenome.getDefaultPos());
FrameManager.getDefaultFrame().setChromosomeName(newGenome.getHomeChromosome(), true);

loadGenomeAnnotations(newGenome);
IGV.getInstance().resetFrames();
IGV.getInstance().getSession().clearHistory();

PreferencesManager.getPreferences().setLastGenome(newGenome.getId());
if(newGenome != Genome.nullGenome()) {
// This should only occur on startup failure
PreferencesManager.getPreferences().setLastGenome(newGenome.getId());
}

if (PreferencesManager.getPreferences().getAsBoolean(Constants.CIRC_VIEW_ENABLED) && CircularViewUtilities.ping()) {
CircularViewUtilities.changeGenome(newGenome);
}

IGVEventBus.getInstance().post(new GenomeChangeEvent(newGenome));
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public JsonGenomeLoader(String genomePath) {
public Genome loadGenome() throws IOException {


try (InputStream is = ParsingUtils.openInputStream(genomePath + "..")){
try (InputStream is = ParsingUtils.openInputStream(genomePath)){

String jsonString = ParsingUtils.readContentsFromStream(is);

Expand Down

0 comments on commit 68d16cf

Please sign in to comment.