Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
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...
commit 7a9374ea52041b3ce08883c8e2afba432ca2259b 1 parent 5cd5306
@ZER0 ZER0 authored
Showing with 1 addition and 1 deletion.
  1. +1 −1  packages/addon-kit/lib/clipboard.js
View
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);
Please sign in to comment.
Something went wrong with that request. Please try again.