Merge pull request #1993 from arunnattarayan/patch-1

Export to library produces empty folder when name has a trailing slash
This commit is contained in:
Nick O'Leary 2018-12-13 11:05:52 +00:00 committed by GitHub
commit a6ef755139
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -447,7 +447,10 @@ RED.library = (function() {
click: function() {
//TODO: move this to RED.library
var flowName = $("#node-input-library-filename").val();
if (!/^\s*$/.test(flowName)) {
flowName = flowName.trim();
if(flowName === "" || flowName.endsWith("/")) {
RED.notify(RED._("library.invalidFilename"),"warning");
} else {
$.ajax({
url:'library/flows/'+flowName,
type: "POST",