[wp-trac] [WordPress Trac] #43005: JavaScript error Cannot read property 'action' of null on chrome
WordPress Trac
noreply at wordpress.org
Sat Jan 6 17:55:30 UTC 2018
#43005: JavaScript error Cannot read property 'action' of null on chrome
-------------------------------------+-------------------------
Reporter: manikmist09 | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: 4.9.2
Component: Upgrade/Install | Version: 4.6
Severity: normal | Resolution:
Keywords: has-patch needs-refresh | Focuses: javascript
-------------------------------------+-------------------------
Changes (by afercia):
* keywords: has-patch 2nd-opinion dev-feedback => has-patch needs-refresh
* version: 4.9.1 => 4.6
* component: Administration => Upgrade/Install
* milestone: Awaiting Review => 4.9.2
Comment:
I have no idea what Grammarly does, and no idea why one would want to use
an empty message, but checking for an object existence before checking for
its properties seems a common best practice to me.
From the jQuery docs:
> Prior to jQuery 1.9, $.parseJSON returned null instead of throwing an
error if it was passed an empty string, null, or undefined, even though
those are not valid JSON.
In other parts in core where `$.parseJSON()` is used, I don't see a great
consistency but at least in one case there's a check for the object being
truthy.
The patch would need a refresh for proper indentation (please use tabs)
and to remove a double space.
Proposing for 4.9.2 consideration.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/43005#comment:7>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list