summaryrefslogtreecommitdiffstats
path: root/src/libdraw/getsubfont.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/libdraw/getsubfont.c')
-rw-r--r--src/libdraw/getsubfont.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/libdraw/getsubfont.c b/src/libdraw/getsubfont.c
index b7a8e44a..2cbec812 100644
--- a/src/libdraw/getsubfont.c
+++ b/src/libdraw/getsubfont.c
@@ -24,10 +24,10 @@ _getsubfont(Display *d, char *name)
* _getsubfont is called only from string.c and stringwidth.c,
* which are known to be safe to have this done.
*/
- if(d->locking == 0)
+ if(d && d->locking == 0)
unlockdisplay(d);
- f = readsubfont(d, name, fd, d->locking==0);
- if(d->locking == 0)
+ f = readsubfont(d, name, fd, d && d->locking==0);
+ if(d && d->locking == 0)
lockdisplay(d);
if(f == 0)
fprint(2, "getsubfont: can't read %s: %r\n", name);