Skip to content
This repository has been archived by the owner on Dec 20, 2022. It is now read-only.

Commit

Permalink
bug fix
Browse files Browse the repository at this point in the history
When entering nothing, there would be no consideration of the emptines
  • Loading branch information
Keheck committed Aug 23, 2019
1 parent 41d9cf8 commit df9a464
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
20 changes: 19 additions & 1 deletion src/io/github/keheck/Tasks.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,25 @@ public static void onNewProject(String projName, String nameSpace, DialogNewProj
{
new Thread(() ->
{
NavTree.cunstructTree(projName, nameSpace);
String myProjName = projName;
String myNamespace = nameSpace;

if(myProjName == null) myProjName = "";
if(myNamespace == null) myNamespace = "";

if(!myProjName.matches("[a-z0-9_]+"))
{
new DialogErrorNameInvalid(myProjName);
return;
}

if(!myNamespace.matches("[a-z0-9_]+"))
{
new DialogErrorNameInvalid(myNamespace);
return;
}

NavTree.cunstructTree(projName, myNamespace);
if(project != null)
project.dispose();
}, "Tree Constructor").start();
Expand Down
1 change: 1 addition & 0 deletions src/io/github/keheck/window/NavTree.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ public class NavTree

public static void cunstructTree(String projName, String nameSpace)
{
if("".equals(nameSpace) || nameSpace == null) nameSpace = projName;
NavTreeFolder root = new NavTreeFolder(FOLDER, projName);
JTree tree = Main.navTree;
tree.getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);
Expand Down

0 comments on commit df9a464

Please sign in to comment.