deserializeJSON with an empty string should throw an exception

Description

On Coldfusion the deserializeJSON-function throws an error when passing an empty string.
The Lucee returns an empty string, which is not a valid json-string in my opinion.

Test:

<cfset test = {} /> <cfset test = deserializeJSON("") /> <cfdump var="#test#" />

Activity

Pothys - MitrahSoft 
12 October 2023 at 15:01

Pothys - MitrahSoft 
6 December 2021 at 09:53

I've checked this ticket with the fixed version and now deserializeJSON() with empty string throws the error. So I marked this ticket as deployed.

Michael Offner 
3 December 2021 at 16:52

please give that build another try

Pothys - MitrahSoft 
17 September 2021 at 16:18
(edited)

Yeah I checked that, works fine

deserializeJSON('""'): works deserializeJSON(""):invalid call of the function DeserializeJSON, first Argument (JSONVar) is invalid, input value cannot be empty string.
Fixed

Details

Assignee

Reporter

New Issue warning screen

Before you create a new Issue, please post to the mailing list first https://dev.lucee.org

Once the issue has been verified, one of the Lucee team will ask you to file an issue

Sprint

Fix versions

Affects versions

Priority

Created 1 April 2021 at 09:25
Updated 7 May 2025 at 09:47
Resolved 6 December 2021 at 09:53