Replace coverity comment with assertion.

This commit is contained in:
Richard Heck 2016-06-14 18:26:08 +01:00
parent b148629d56
commit 0fa905ceab

View File

@ -1671,15 +1671,17 @@ void GuiApplication::dispatch(FuncRequest const & cmd, DispatchResult & dr)
boost::crc_32_type crc; boost::crc_32_type crc;
crc = for_each(fname.begin(), fname.end(), crc); crc = for_each(fname.begin(), fname.end(), crc);
createView(crc.checksum()); createView(crc.checksum());
// we know current_view_ is non-null, because createView sets it. // we know current_view_ is non-null, because createView sets it.
// coverity[FORWARD_NULL] // but let's make sure
LASSERT(current_view_, break);
current_view_->openDocument(fname); current_view_->openDocument(fname);
// FIXME but then why check current_view_ here? // FIXME but then why check current_view_ here?
if (current_view_ && !current_view_->documentBufferView()) if (current_view_ && !current_view_->documentBufferView())
current_view_->close(); current_view_->close();
} else { } else {
// we know !d->views.empty(), so this should be ok // we know !d->views.empty(), so this should be ok
// coverity[FORWARD_NULL] // but let's make sure
LASSERT(current_view_, break);
current_view_->openDocument(fname); current_view_->openDocument(fname);
} }
break; break;