Skip to content

Commit

Permalink
Add null check to avoid NPE (apache#28429)
Browse files Browse the repository at this point in the history
  • Loading branch information
strongduanmu authored Sep 13, 2023
1 parent 51b3b25 commit 5845e11
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -94,18 +94,18 @@ public Optional<IdentifierValue> getOwner() {
* @return original table
*/
public IdentifierValue getOriginalTable() {
if (Strings.isNullOrEmpty(originalTable.getValue())) {
if (null == originalTable || Strings.isNullOrEmpty(originalTable.getValue())) {
return null == owner ? new IdentifierValue("") : owner;
}
return originalTable;
}

/**
* Get original column.
*
*
* @return original column
*/
public IdentifierValue getOriginalColumn() {
return Strings.isNullOrEmpty(originalColumn.getValue()) ? name : originalColumn;
return null == originalColumn || Strings.isNullOrEmpty(originalColumn.getValue()) ? name : originalColumn;
}
}

0 comments on commit 5845e11

Please sign in to comment.