Avoid deferencing a null pointer.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@30805 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Enrico Forestieri 2009-07-30 03:21:04 +00:00
parent 56ba7b60b1
commit 3e9489d870

View File

@ -115,7 +115,8 @@ TeXEnvironment(Buffer const & buf,
ParagraphList::const_iterator const priorpit = ParagraphList::const_iterator const priorpit =
pit == paragraphs.begin() ? pit : boost::prior(pit); pit == paragraphs.begin() ? pit : boost::prior(pit);
bool const use_prev_env_language = priorpit->layout().isEnvironment() bool const use_prev_env_language = prev_env_language_ != 0
&& priorpit->layout().isEnvironment()
&& (priorpit->getDepth() > pit->getDepth() && (priorpit->getDepth() > pit->getDepth()
|| (priorpit->getDepth() == pit->getDepth() || (priorpit->getDepth() == pit->getDepth()
&& priorpit->layout() != pit->layout())); && priorpit->layout() != pit->layout()));
@ -352,7 +353,8 @@ ParagraphList::const_iterator TeXOnePar(Buffer const & buf,
// environment with nesting depth greater than (or equal to, but with // environment with nesting depth greater than (or equal to, but with
// a different layout) the current one. If there is no previous // a different layout) the current one. If there is no previous
// paragraph, the previous language is the outer language. // paragraph, the previous language is the outer language.
bool const use_prev_env_language = priorpit->layout().isEnvironment() bool const use_prev_env_language = prev_env_language_ != 0
&& priorpit->layout().isEnvironment()
&& (priorpit->getDepth() > pit->getDepth() && (priorpit->getDepth() > pit->getDepth()
|| (priorpit->getDepth() == pit->getDepth() || (priorpit->getDepth() == pit->getDepth()
&& priorpit->layout() != pit->layout())); && priorpit->layout() != pit->layout()));