Crash @WebContentsDelegateEfl::DidFinishLoad
authorAntonio Gomes <a1.gomes@samsung.com>
Mon, 4 May 2015 22:24:32 +0000 (18:24 -0400)
committerYoungsoo Choi <kenshin.choi@samsung.com>
Tue, 10 Jul 2018 06:57:09 +0000 (06:57 +0000)
commit3bae4453979765e34b1f47f92b3fbd237b2779fa
treed6375a8d5d0ddfd25d19040f54942e992257d36e
parentf793f069aa8fe79dc8fcff9d3b0173b2417388d2
Crash @WebContentsDelegateEfl::DidFinishLoad

When a new window is being opened, it might happen that
about:blank is loaded first, and the actual target URL load
is triggered later.
When that happens, two calls to WebContentsDelegateEfl::DidFinishLoad
are made during the load.
When the first call is made (associated to about:blank) no entry
is added to the NavigationController control, and GetVisibleEntry
returns NULL.

Our implementation wrongly assumed that calling this method would
always return non-null values, and an DCHECK was added.
Patch fixes that assumption by replacing the DCHECK by a null-check.

Note the the signature of the associated NavigationController method
also clearly states that it can return a NULL value:
https://goo.gl/RBiSEu

"
NOTE: This can be nullptr if no entry has committed!
"

Bug: http://107.108.218.239/bugzilla/show_bug.cgi?id=12867
Change-Id: Ie2f2253c7ec14e15f0b67910023a59d96f71b6f6
Signed-off-by: Antonio Gomes <a1.gomes@samsung.com>
tizen_src/ewk/efl_integration/web_contents_delegate_efl.cc