Skip to content

Commit

Permalink
Don't call dataTransfer.setDragImage on Sarari
Browse files Browse the repository at this point in the history
It seems to cause Safari 6.0.2 to follow a null pointer and crash.
  • Loading branch information
marijnh committed Dec 5, 2012
1 parent f7fe5cd commit 821cfe1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/codemirror.js
Expand Up @@ -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);
}

Expand Down

0 comments on commit 821cfe1

Please sign in to comment.