Skip to content

Commit fddcbbd

Browse files
committed
Fixed NPE.
1 parent 22e831c commit fddcbbd

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

unsafe/src/main/java/org/apache/spark/unsafe/types/UTF8String.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -402,6 +402,10 @@ public UTF8String lpad(int len, UTF8String pad) {
402402
* For example, concat("a", null, "c") would yield "ac".
403403
*/
404404
public static UTF8String concat(UTF8String... inputs) {
405+
if (inputs == null) {
406+
return fromBytes(new byte[0]);
407+
}
408+
405409
// Compute the total length of the result.
406410
int totalLength = 0;
407411
for (int i = 0; i < inputs.length; i++) {

0 commit comments

Comments
 (0)