BlackoilOutputWriter: fix restore when last step is selected.

This commit is contained in:
Robert Kloefkorn 2015-04-24 10:53:23 +02:00
parent 4b7440ad78
commit c846418446

View File

@ -331,11 +331,17 @@ namespace Opm
break;
}
// try to read next report step
restorefile.read( (char *) &reportStep, sizeof(int) );
// if read failed, exit loop
if( ! restorefile ) {
break;
}
// next step
timer.advance();
// read next report step
restorefile.read( (char *) &reportStep, sizeof(int) );
if( timer.reportStepNum() != reportStep ) {
break;
}