summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--usr.bin/vi/ex/ex.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/usr.bin/vi/ex/ex.c b/usr.bin/vi/ex/ex.c
index f92d8f7c4f9..ca3227b09d4 100644
--- a/usr.bin/vi/ex/ex.c
+++ b/usr.bin/vi/ex/ex.c
@@ -2307,7 +2307,7 @@ ex_badaddr(sp, cp, ba, nret)
* underlying file, that's the real problem.
*/
if (sp->ep == NULL) {
- ex_emsg(sp, cp->name, EXM_NOFILEYET);
+ ex_emsg(sp, cp != NULL ? cp->name : NULL, EXM_NOFILEYET);
return;
}