Browse files

Fixed `clipboard.set` method when an empty string is given without a …

…flavor [regression]

`DataURL` object can accept empty uri in order to works as builder for data url and not only as parser. So if an empty string is given in `clipboard`, a proper `DataURL` is created, even if it should be created only to "parse" a possible data url, so only if a `data` is provided. This fix makes `clipboard.set('')` works again.
  • Loading branch information...
1 parent 5cd5306 commit 7a9374ea52041b3ce08883c8e2afba432ca2259b @ZER0 ZER0 committed Jun 15, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 packages/addon-kit/lib/clipboard.js
2 packages/addon-kit/lib/clipboard.js
@@ -68,7 +68,7 @@ exports.set = function(aData, aDataType) {
// If `aDataType` is not given or if it's "image", the data is parsed as
// data URL to detect a better datatype
- if (!aDataType || aDataType === "image") {
+ if (aData && (!aDataType || aDataType === "image")) {
try {
let dataURL = new DataURL(aData);

0 comments on commit 7a9374e

Please sign in to comment.