From: Robert Pluim Date: Thu, 11 Feb 2021 15:53:13 +0000 (+0100) Subject: Don't crash if we can't find a monitor model name X-Git-Tag: emacs-29.0.90~3727 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=175ebb010477ff0e174fe5145154397f43dee2d2;p=emacs.git Don't crash if we can't find a monitor model name This can happen when running emacs over a forwarded X11 connection. * src/pgtkfns.c (pgtk_get_monitor_scale_factor): Return 0 if we're passed a NULL model name. --- diff --git a/src/pgtkfns.c b/src/pgtkfns.c index cee24c1ad12..07636a25ca0 100644 --- a/src/pgtkfns.c +++ b/src/pgtkfns.c @@ -66,6 +66,9 @@ static Lisp_Object monitor_scale_factor_alist; static double pgtk_get_monitor_scale_factor (const char *model) { + if (model == NULL) + return 0.0; + Lisp_Object mdl = build_string (model); Lisp_Object tem = Fassoc(mdl, monitor_scale_factor_alist, Qnil); if (NILP (tem))