File tree Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -86,7 +86,11 @@ class SketcherExport PropertyConstraintList : public App::PropertyLists
86
86
*/
87
87
void setValues (const std::vector<Constraint*>&);
88
88
89
- // / index operator
89
+ /* !
90
+ Index operator
91
+ \note If the geometry is invalid then the index operator
92
+ returns null. This must be checked by the caller.
93
+ */
90
94
const Constraint *operator [] (const int idx) const {
91
95
return invalidGeometry ? 0 : _lValueList[idx];
92
96
}
@@ -112,7 +116,6 @@ class SketcherExport PropertyConstraintList : public App::PropertyLists
112
116
void acceptGeometry (const std::vector<Part::Geometry *> &GeoList);
113
117
void checkGeometry (const std::vector<Part::Geometry *> &GeoList);
114
118
bool scanGeometry (const std::vector<Part::Geometry *> &GeoList) const ;
115
- bool isGeometryInvalid (){return invalidGeometry;}
116
119
117
120
// / Return status of geometry for better error reporting
118
121
bool hasInvalidGeometry () const { return invalidGeometry; }
Original file line number Diff line number Diff line change @@ -102,6 +102,12 @@ class ConstraintItem : public QListWidgetItem
102
102
103
103
const Sketcher::Constraint * constraint = sketch->Constraints [ConstraintNbr];
104
104
105
+ // it can happen that the geometry of the sketch is tmp. invalid and thus
106
+ // the index operator returns null.
107
+ if (!constraint) {
108
+ return QVariant ();
109
+ }
110
+
105
111
if (role == Qt::EditRole) {
106
112
if (value.isValid ())
107
113
return value;
You can’t perform that action at this time.
0 commit comments