Skip to content

Commit

Permalink
fix if surname is null
Browse files Browse the repository at this point in the history
  • Loading branch information
Victor authored and Victor committed Jan 31, 2023
1 parent d32c3b0 commit 3816a8a
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
11 changes: 10 additions & 1 deletion ldif/src/main/java/ldapCreater/LDAPCreater.java
Original file line number Diff line number Diff line change
Expand Up @@ -291,12 +291,21 @@ private void work(int currentThreadIndex) {
public void getOneLDAP(String line, int i) {

String[] lines = line.split(" ");

String lastName = lines[0];
String name = lines[1];
String surName = null;

if (lines.length == 3) {
surName = lines[2];
}

String transLitName = null;

int itr;
for (itr = 0; itr < 4; itr++) {

transLitName = trs[i].convert(lines[1], lines[0], lines[2], itr);
transLitName = trs[i].convert(name, lastName, surName, itr);

String pass = genPass();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,11 @@ public String convert(final String name, final String lastname, String surname,
}

private String getTransLitFirstSymbol(final String line) {

if (line == null) {
return "";
}

firstSymbol = true;

String result = null;
Expand All @@ -134,6 +139,10 @@ private String getTransLitFirstSymbol(final String line) {

private String getTransLitLine(final String line) {

if (line == null) {
return "";
}

StringBuilder resultLine = new StringBuilder();

firstSymbol = true;
Expand Down

0 comments on commit 3816a8a

Please sign in to comment.