Skip to content

Commit

Permalink
Temporary patch for bug #105
Browse files Browse the repository at this point in the history
  • Loading branch information
petebrew committed Dec 18, 2017
1 parent a9de2a2 commit 85bfe15
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/main/java/org/tellervo/desktop/sample/TellervoWSILoader.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.tellervo.desktop.core.App;
import org.tellervo.desktop.io.Metadata;
import org.tellervo.desktop.ui.Alert;
import org.tellervo.desktop.wsi.tellervo.NewTridasIdentifier;
import org.tellervo.desktop.wsi.tellervo.TellervoResourceAccessDialog;
import org.tellervo.desktop.wsi.tellervo.resources.SeriesResource;
Expand All @@ -37,6 +39,7 @@
import org.tridas.schema.TridasDerivedSeries;
import org.tridas.schema.TridasIdentifier;
import org.tridas.schema.TridasRadius;
import org.tellervo.desktop.wsi.tellervo.NewTridasIdentifier;


/**
Expand Down Expand Up @@ -199,7 +202,14 @@ protected SeriesResource getResource(Sample s, Map<String, ? extends Object> pro
TridasIdentifier seriesIdentifier = s.getSeries().getIdentifier();

if(seriesIdentifier == null)
throw new NullPointerException("Series identifier must not be null for save; use new or existing");
{
log.warn("Expecting the identifier to not be null. Proceeding is if saving a new series");
seriesIdentifier = NewTridasIdentifier.getInstance(App.domain);
s.getSeries().setIdentifier(seriesIdentifier);
Alert.message("Provisional Fix", "A workaround to a bug has just been applied. Please check your series saved successfully and let the developers know if not!");

//throw new NullPointerException("Series identifier must not be null for save; use new or existing");
}

// if we're creating a derived series, we have to be careful here and copy it
// this is because we don't want to send along any values!
Expand Down

0 comments on commit 85bfe15

Please sign in to comment.