removed regex in if statement

Co-Authored-By: arunnattarayan <arunkumarit02@gmail.com>
This commit is contained in:
Nick O'Leary 2018-12-06 19:20:43 +05:30 committed by GitHub
parent 06a1f30350
commit 7b80ae42e1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -447,7 +447,8 @@ RED.library = (function() {
click: function() {
//TODO: move this to RED.library
var flowName = $("#node-input-library-filename").val();
if(flowName.split(/[\\/]/).pop() === "" || /^\s*$/.test(flowName)) {
flowName = flowName.trim();
if(flowName === "" || flowName.endsWith("/")) {
RED.notify(RED._("library.invalidFilename"),"warning");
} else {
$.ajax({