Bug 338980

Summary: Umbrello crashes when adding name to line between normal and branch widget
Product: [Applications] umbrello Reporter: Øystein S. Haaland <oystein.s.haaland>
Component: generalAssignee: Oliver Kellogg <okellogg>
Status: RESOLVED FIXED    
Severity: crash CC: okellogg
Priority: NOR    
Version: Git   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed In: 4.14.1
Attachments: Drkonqi report

Description Øystein S. Haaland 2014-09-10 14:39:49 UTC
Umbrello crashes when adding name to line between normal and branch widget

Reproducible: Always

Steps to Reproduce:
1. Created a new activity diagram
2. Created a start, a normal and a branch widget
3. Added a line between start and normal widget
4. Added a line between normal and branch widget
5. Added name for line between normal and branch widget in widget dialog


Actual Results:  
Umbrelo crashed when clicking ok

Expected Results:  
No crash
Comment 1 Øystein S. Haaland 2014-09-10 14:42:17 UTC
Created attachment 88642 [details]
Drkonqi report

Drkonki didn't manage to send the information, saying i have to login in first even though i logged in in an earlier step.
Comment 2 Oliver Kellogg 2014-09-10 19:11:27 UTC
Confirm on git master.
Analysis:
AssociationGeneralPage::updateObject() accesses  m_pStereoChkB->isChecked() without prior check of m_pStereoChkB against NULL.
However, m_pStereoChkB is only non NULL for associations which have an underlying UML object, see umbrello/dialogs/pages/associationgeneralpage.cpp:113 ff.:
    if (umlAssoc) {
        // stereotype checkbox
        m_pStereoChkB = new QCheckBox(i18n("Stereotype"), nameAndTypeGB);
        [...]
    }
Comment 3 Oliver Kellogg 2014-09-10 19:17:02 UTC
Git commit 292b7446548e67522ef7066b88f2c3b9ecfff7ac by Oliver Kellogg.
Committed on 10/09/2014 at 19:18.
Pushed by okellogg into branch 'master'.

Fix for crash setting name on diagram-only association via Association
Properties page according to analysis in comment #2:

umbrello/dialogs/pages/associationgeneralpage.cpp
- In function updateObject() add test of m_pStereoChkB against NULL before
  dereferencing.

M  +1    -1    umbrello/dialogs/pages/associationgeneralpage.cpp

http://commits.kde.org/umbrello/292b7446548e67522ef7066b88f2c3b9ecfff7ac
Comment 4 Oliver Kellogg 2014-09-10 20:11:09 UTC
Git commit 2537f92573a0c85dea38a588152a5cff6cba33b7 by Oliver Kellogg.
Committed on 10/09/2014 at 20:10.
Pushed by okellogg into branch 'KDE/4.14'.

Merge master@286493f into KDE/4.14
Related: bug 338983
FIXED-IN:4.14.1
FIXED-IN:4.14.1


http://commits.kde.org/umbrello/2537f92573a0c85dea38a588152a5cff6cba33b7
Comment 5 Øystein S. Haaland 2014-09-11 06:07:10 UTC
I can confirm that it works. Thanks a lot for the quick fix!