Bug 377037

Summary: PageRow: pushing to pageStack produces TypeError (Cannot write property of null).
Product: [Frameworks and Libraries] frameworks-kirigami Reporter: jm.ouwerkerk
Component: generalAssignee: Marco Martin <notmart>
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version First Reported In: Master   
Target Milestone: Not decided   
Platform: Debian unstable   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: QML example demonstrating the issue

Description jm.ouwerkerk 2017-02-28 22:19:02 UTC
Created attachment 104279 [details]
QML example demonstrating the issue

It is possible to provoke the Kirigami PageRow component into attempting to deref a null value by pushing a new page to the pageStack.

Steps to Reproduce:

 1. Load the attached QML file with qmlscene
 2. Click the "Demonstrate the bug" button 3 times or more (it doesn't need 'rapid' clicks, just repeated clicks to trigger the bug).
 3. Observe the console output of qmlscene: on or more TypeErrors should be reported, the first of which references line 436 of the PageRow source.

Burried inside the PageRow component, at lines 436 the following is attempted:

```
    // at line 435:
    onPageChanged: {
        page.parent = container;
        page.anchors.fill = container;
    }
```
Comment 1 jm.ouwerkerk 2017-02-28 23:18:59 UTC
Qt version: 5.7.1
Comment 2 Marco Martin 2017-04-11 19:28:23 UTC
Git commit 2fb69458af1e4e76cbff68f11f18457ff13bca75 by Marco Martin.
Committed on 11/04/2017 at 19:28.
Pushed by mart into branch 'master'.

don't re-push pages already in

if a page is contained in the pagerow, never re-push it again

M  +19   -0    src/controls/PageRow.qml

https://commits.kde.org/kirigami/2fb69458af1e4e76cbff68f11f18457ff13bca75