goo/GooString.cc | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-)
New commits: commit 757b566fc14b3d9e33b50387afe9dced709006b2 Author: Albert Astals Cid <[email protected]> Date: Fri Oct 22 17:38:17 2021 +0200 Don't crash if the GooString * is null diff --git a/goo/GooString.cc b/goo/GooString.cc index 2f8aa985..54e8bc52 100644 --- a/goo/GooString.cc +++ b/goo/GooString.cc @@ -18,7 +18,7 @@ // Copyright (C) 2006 Kristian Høgsberg <[email protected]> // Copyright (C) 2006 Krzysztof Kowalczyk <[email protected]> // Copyright (C) 2007 Jeff Muizelaar <[email protected]> -// Copyright (C) 2008-2011, 2016-2018 Albert Astals Cid <[email protected]> +// Copyright (C) 2008-2011, 2016-2018, 2021 Albert Astals Cid <[email protected]> // Copyright (C) 2011 Kenji Uno <[email protected]> // Copyright (C) 2012, 2013 Fabio D'Urso <[email protected]> // Copyright (C) 2012, 2017 Adrian Johnson <[email protected]> @@ -418,8 +418,13 @@ GooString *GooString::appendfv(const char *fmt, va_list argList) reverseAlign = !reverseAlign; break; case fmtGooString: - str = arg.gs->c_str(); - len = arg.gs->getLength(); + if (arg.gs) { + str = arg.gs->c_str(); + len = arg.gs->getLength(); + } else { + str = "(null)"; + len = 6; + } reverseAlign = !reverseAlign; break; case fmtSpace:
