Skip to content

Commit

Permalink
Fix error from empty strings in data generator
Browse files Browse the repository at this point in the history
  • Loading branch information
dstillman committed Mar 21, 2017
1 parent 8bc5d37 commit d9b5fd7
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions chrome/content/zotero/tools/data_generator.html
Expand Up @@ -79,13 +79,16 @@

var rand = Zotero.Utilities.rand;
function randStr(min, max) {
return Zotero.Utilities.randomString(
rand(min, max),
"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"
+ "éØü"
+ "漢字"
+ " "
);
var chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"
+ "éØü"
+ "漢字"
+ " "
do {
var rnd = Zotero.Utilities.randomString(rand(min, max), chars);
}
// Make sure string isn't all spaces
while (rnd.trim().length == 0);
return rnd;
}

function addCreatorOfType(creators, creatorType) {
Expand Down

0 comments on commit d9b5fd7

Please sign in to comment.