[LyX/master] Make sure to not dereference a null pointer.

Enrico Forestieri forenr at lyx.org
Mon Feb 10 20:36:25 UTC 2020


commit 536d476d38c16ae29ea941046e6544eb20b41127
Author: Enrico Forestieri <forenr at lyx.org>
Date:   Mon Feb 10 21:54:07 2020 +0100

    Make sure to not dereference a null pointer.
---
 src/mathed/MathParser.cpp |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/mathed/MathParser.cpp b/src/mathed/MathParser.cpp
index 9c2db23..c38acca 100644
--- a/src/mathed/MathParser.cpp
+++ b/src/mathed/MathParser.cpp
@@ -2083,7 +2083,7 @@ bool Parser::parse1(InsetMathGrid & grid, unsigned flags,
 							Encodings::MATH_CMD | Encodings::TEXT_CMD,
 							is_combining, termination);
 					}
-					if (c && buf->params().encoding().encodable(c)) {
+					if (c && buf && buf->params().encoding().encodable(c)) {
 						if (termination) {
 							if (nextToken().cat() == catBegin) {
 								getToken();


More information about the lyx-cvs mailing list