Uncaught TypeError: Cannot read property 'style' of null

xiaix
Tera Guru

find_real_file.png

 

find_real_file.png

 

I'm looking at an RITM.

On this RITM, I have a Macro variable (pointing to a SP Widget) that seems to be causing this issue.  If I make this macro variable active = false, this RITM loads fine.

 

Since the error is on ServiceNow's code side, I suppose there's no fix for this... however, it leaves one to beg the question, why do the individuals that code ServiceNow itself never do any try/catch or "if element exists" code???

Bad coding practice (ServiceNow default):

ge.getElementParentNode().style.display = "none"

Good coding practice:

if (ge.getElementParentNode())
     ge.getElementParentNode().style.display = "none"

 

The problem is, because of this error, the entire page breaks and any UI Policy, Client Script, ... anything that uses JavaScript fails.

1 ACCEPTED SOLUTION

rajesh9885
Mega Guru

Found the same issue with Kingston and was given this workaround and it worked for us

 

The workaround can also be found using the following URL:
KB0691852 - Request Item and Service catalog task forms are broken after upgrading Kingston Patch 6

 

regards

View solution in original post

6 REPLIES 6

Yep, same here.  Thanks!

svani
Tera Contributor

Hi @xiaix ,

 

Do you know the workaround for this,

i am unable to view the article .

please help me on this.

 

thanks in advance,