1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00

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

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",