Skip to content

Commit 2d75594

Browse files
bondakra
authored andcommitted
Check for file name before comparing
1 parent 5f30f17 commit 2d75594

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

blacken.el

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,8 @@ Return black process the exit code."
117117
(list "--fast"))
118118
(when blacken-skip-string-normalization
119119
(list "--skip-string-normalization"))
120-
(when (string-match "\.pyi$" (buffer-file-name (current-buffer)))
120+
(when (and (buffer-file-name (current-buffer))
121+
(string-match "\.pyi$" (buffer-file-name (current-buffer))))
121122
(list "--pyi"))
122123
'("-")))
123124

0 commit comments

Comments
 (0)