]> git.eshelyaron.com Git - emacs.git/commitdiff
Don't compare arguments that can be nil
authorOscar Fuentes <ofv@wanadoo.es>
Sat, 16 Dec 2017 00:34:35 +0000 (01:34 +0100)
committerOscar Fuentes <ofv@wanadoo.es>
Sat, 16 Dec 2017 00:37:21 +0000 (01:37 +0100)
copy-region-as-kill can be called passing nil as `beg' and
`end'. Magit does that, which caused an error when this advice was in
effect.

* lisp/ses.el (ses--advice-copy-region-as-kill): avoid comparison
  unless `beg' and `end' are non-nil.

lisp/ses.el

index 4c19c70c5da3ace5149a4433353eab7d53c0dd3d..188992c78fbabc6d0eb96bbbedc8f804fb377628 100644 (file)
@@ -3051,7 +3051,7 @@ We'll assume copying front-sticky properties doesn't make sense, either.
 
 This advice also includes some SES-specific code because otherwise it's too
 hard to override how mouse-1 works."
-  (when (> beg end)
+  (when (and beg end (> beg end))
     (let ((temp beg))
       (setq beg end
            end temp)))