New issue
Advanced search Search tips

Issue 890580 link

Starred by 7 users

Issue metadata

Status: Fixed
Owner:
Closed: Dec 13
Components:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 2
Type: Bug



Sign in to add a comment

[Chrome DevTools] TypeError: Cannot read property 'length' of null

Reported by rgsamw...@gmail.com, Sep 29

Issue description

UserAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36

Steps to reproduce the problem:
1. Open Dev Tools
2. Select Application
3. Select WebSQL
4. Select your database
5. Run "select" query on a table containing records (some possibly having a column with a null value)

What is the expected behavior?
Records returned successfully.

What went wrong?
TypeError: Cannot read property 'length' of null

The table I am running a simple select on has many columns. Running a select with some columns instead of "*" works, but not others. Also, a simple "select * from <table_name>" is returning this error.

Did this work before? N/A 

Chrome version: 69.0.3497.100  Channel: stable
OS Version: 10.0
Flash Version: 

Not sure when this problem began. Probaly within the last 3 months or so. Not sure why it used to work and now it produces errors.
 
Status: Untriaged (was: Unconfirmed)
The automatic column sizing is trying to determine the length of the value, but the value is null and not a string.
database-select-all-from-null-column-exception.PNG
21.4 KB View Download
Non-null (but also non-string) value avoid the error because even if the length field does not exist for them, accessing it does not throw (null.field throws, 1..length simply returns undefined), but the automatic sizing code will probably yield the wrong width for them.
Owner: hhli@chromium.org
Hello there, has any progress been made to fix this issue?
Also having this issue. Would love to see it fixed.
Status: Assigned (was: Untriaged)
Reproduce guide:
1. goto https://webkit.org/demos/sticky-notes/
2. open DevTools > Application > Web SQL > NoteTest
3. see image


Screen Shot 2018-12-13 at 13.39.50.png
14.2 KB View Download
Screen Shot 2018-12-13 at 13.46.52.png
15.6 KB View Download
CL1377145 fix:

Screen Shot 2018-12-13 at 13.53.34.png
21.5 KB View Download
Status: Fixed (was: Assigned)
Project Member

Comment 10 by bugdroid1@chromium.org, Dec 13

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/ee6a7e474d81922cf2193ca5b5ad1cf8778d03de

commit ee6a7e474d81922cf2193ca5b5ad1cf8778d03de
Author: Harley Li <hhli@chromium.org>
Date: Thu Dec 13 23:34:13 2018

[DevTools] WebSQL grid shows error if a field is null

UI: ensure 'text' is string before accessing its field
Otherwise there is  an error "TypeError: Cannot read property 'length'
of null"

Bug:  890580 
Change-Id: Iecf705fc4c8956446dd695c673e6dcf7c3a1fe41
Reviewed-on: https://chromium-review.googlesource.com/c/1377145
Commit-Queue: Haihong Li (Harley) <hhli@chromium.org>
Reviewed-by: Erik Luo <luoe@chromium.org>
Cr-Commit-Position: refs/heads/master@{#616486}
[modify] https://crrev.com/ee6a7e474d81922cf2193ca5b5ad1cf8778d03de/third_party/blink/renderer/devtools/front_end/data_grid/DataGrid.js

Labels: TE-Verified-73.0.3640.0 TE-Verified-M73
Able to reproduce this issue on Windows 10 on the reported version 69.0.3497.100 and the issue is fixed on the latest M-73 build 73.0.3640.0 as per comment #7.

1. Launched Chrome and navigated to https://webkit.org/demos/sticky-notes/.
2. Opened DevTools -> Application -> Web SQL -> NoteTest.
3. Entered 'INSERT INTO WebKitStickyNotes VALUES (2.null,0,0,0,0);' and SELECT * FROM WebKitStickyNotes; and could observe that the records are returned successfully.

Attached is the screen shot for reference.

Hence adding TE verified labels as the fix is working as intended.

Thanks..
890580-M73.PNG
90.0 KB View Download
Thanks all!! This bug actually forced us to re-write some code, but I think it will be worth it. I'll keep an eye out for the fix in the legacy project. Cheers.

Sign in to add a comment