Permalink
Browse files

Don't call dataTransfer.setDragImage on Sarari

It seems to cause Safari 6.0.2 to follow a null pointer and crash.
  • Loading branch information...
1 parent f7fe5cd commit 821cfe1b0f0823906ae296ae3556d21df8ddd601 @marijnh marijnh committed Dec 5, 2012
Showing with 2 additions and 1 deletion.
  1. +2 −1 lib/codemirror.js
View
@@ -1546,7 +1546,8 @@ window.CodeMirror = (function() {
e.dataTransfer.setData("Text", txt);
// Use dummy image instead of default browsers image.
- if (e.dataTransfer.setDragImage)
+ // Recent Safari (~6.0.2) have a tendency to segfault when this happens, so we don't do it there.
+ if (e.dataTransfer.setDragImage && !safari)
e.dataTransfer.setDragImage(elt('img'), 0, 0);
}

0 comments on commit 821cfe1

Please sign in to comment.