BUG: missing guard for empty list (see b2bc1d6546)

This commit is contained in:
Mark Olesen
2019-04-24 12:28:40 +02:00
committed by Andrew Heather
parent 391afe7854
commit 88cf93c4e7

View File

@ -655,7 +655,11 @@ bool Foam::Time::writeObject
// Does the writeTime trigger purging?
if (writeTime_ && purgeWrite_)
{
if (previousWriteTimes_.top() != timeName())
if
(
previousWriteTimes_.empty()
|| previousWriteTimes_.top() != timeName()
)
{
previousWriteTimes_.push(timeName());
}