fixes an multiple-load issue leading to NPE when adding empty generator

streams
This commit is contained in:
Eyck Jentzsch 2024-02-11 12:35:10 +01:00
parent 64cc09d207
commit 5f244dc03a
2 changed files with 3 additions and 3 deletions

View File

@ -239,9 +239,9 @@ public class FtrDbLoader implements IWaveformDbLoader {
long startTime = cborDecoder.readInt()*time_scale_factor;
long endTime = cborDecoder.readInt()*time_scale_factor;
TxGenerator gen = txGenerators.get(genId);
FtrTx scvTx = new FtrTx(txId, gen.stream.getId(), genId, startTime, endTime, blockId, blockOffset);
TxStream stream = gen.stream;
FtrTx scvTx = new FtrTx(txId, stream.getId(), genId, startTime, endTime, blockId, blockOffset);
updateTransactions(txId, scvTx);
TxStream stream = txStreams.get(gen.stream.getId());
if (scvTx.beginTime == scvTx.endTime) {
stream.addEvent(new TxEvent(this, EventKind.SINGLE, txId, scvTx.beginTime));
gen.addEvent(new TxEvent(this, EventKind.SINGLE, txId, scvTx.beginTime));

View File

@ -65,7 +65,7 @@ class TxGenerator extends AbstractTxStream {
*/
@Override
public IEventList getEvents() {
if(events.size()==0) {
if(stream.events.size()==0) {
try {
List<byte[]> chunks = stream.getChunks();
int blockid = 0;