Opened 8 years ago

Closed 7 years ago

Last modified 7 years ago

#15191 closed defect (fixed)

[regression] dojo.query fails when passed null

Reported by: tj.vantoll Owned by: Kris Zyp
Priority: undecided Milestone: 1.7.5
Component: Query Version: 1.7.2
Keywords: Cc:
Blocked By: Blocking:

Description

In 1.6.1 passing null to dojo.query returned an empty array - http://jsbin.com/oluxaw/edit#source.

In 1.7.2 it gives a JS error of "Uncaught TypeError?: Cannot read property 'orphan' of null" - http://jsbin.com/iyafaf/edit#source.

I have used this to pass dojo.query the result of dojo.byId that may or may not exist. If it exists I want to attach a handler. I ran into this issue when upgrading from 1.6.1 to 1.7.2.

An empty array is also returned by jQuery - http://jsbin.com/ofinuk/edit#javascript,html.

Thanks.

Change History (4)

comment:1 Changed 7 years ago by Kris Zyp

Resolution: fixed
Status: newclosed

In [29041]:

Return an empty array from a query for null, fixes #15191 !strict

comment:2 Changed 7 years ago by bill

Milestone: tbd1.8

comment:3 Changed 7 years ago by Colin Snover

In [30031]:

Return an empty array from a query for null, fixes #15191 !strict Backport to 1.7.

comment:4 Changed 7 years ago by Colin Snover

Milestone: 1.81.7.5
Summary: dojo.query fails when passed null[regression] dojo.query fails when passed null

According to the OP this is a regression and should have been backported to 1.7.

Note: See TracTickets for help on using tickets.