Issue with `Duplicate()` Function Causing Null Pointer Exception in BoxLang

Description

Encountering an issue with the Duplicate() function in BoxLang. When Duplicate() is used to copy a struct that contains a variable with a null value, it throws a null pointer exception. This exception occurs only when the null value is inside a struct. If the null value is directly assigned to a variable and duplicated, the function works correctly.

Code Example:

local.testStruct = {
key1 = "value1",
key2 = javaCast("null", "") // Null value
};

// Attempt to duplicate the struct
local.duplicateStruct = Duplicate(local.testStruct);

Activity

Show:

Luis Majano September 4, 2024 at 8:35 AM

This is now resolved

 

Luis Majano September 3, 2024 at 10:40 AM

I was able to reproduce it.

 

Fixed
Pinned fields
Click on the next to a field label to start pinning.

Details

Assignee

Reporter

Fix versions

Priority

Sentry

Created September 3, 2024 at 10:30 AM
Updated September 5, 2024 at 10:34 AM
Resolved September 3, 2024 at 2:21 PM