tracker issue : CF-4204063

select a category, or use search below
(searches all categories and all time range)
Title:

IsNull() Always returns true when Evaluating a Safe Navigation expression

| View in Tracker

Status/Resolution/Reason: To Fix/Fixed/Fixed

Reporter/Name(from Bugbase): Robert Y. / ()

Created: 03/04/2019

Components: Language

Versions: 2016,2018

Failure Type: Incorrectly functioning

Found In Build/Fixed In Build: 2016.0.10.314028 / 2018,0,05,315175

Priority/Frequency: Normal / All users will encounter

Locale/System: English / Windows 10 64 bit

Vote Count: 0

Problem Description:
Passing an expression that uses the Safe Navigation Operator to the isNull function will always return true even if the value is not null. Storing the value in a variable first and passing that variable to isNull does not cause this issue.
Steps to Reproduce:
var a = {
	b: {
		c: 'test'
	}
};

var Test = a?.b?.c;
var result1 = isNull( a?.b?.c );
var result2 = isNull( test);

Actual Result:
The variable Test will equal 'test'. The variable result1 equals 'YES'. The variable result2 equals 'NO'.

Expected Result:
It seems that result1 and result2 should both equal 'NO'.

Any Workarounds:
Store the value in a variable before passing it to isNull.

Attachments:

Comments: