Skip to content

Commit 5809520

Browse files
committed
fix a crash during recomp
1 parent b552b9d commit 5809520

File tree

1 file changed

+14
-8
lines changed

1 file changed

+14
-8
lines changed

src/row.c

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -219,15 +219,21 @@ row_dirty_set_single(Row *row, gboolean clear_error)
219219
static void *
220220
row_dirty_set_sub(Model *model, gboolean clear_error)
221221
{
222-
if (IS_ROW(model)) {
223-
Row *row = ROW(model);
224-
Rhs *rhs = row->child_rhs;
225-
226-
g_assert(!rhs || IS_RHS(rhs));
227-
228-
if (rhs && rhs->itext && ITEXT(rhs->itext)->edited)
222+
Row *row;
223+
Rhs *rhs;
224+
225+
// child_rhs can be garbage during recomp :(
226+
if (IS_ROW(model) &&
227+
(row = ROW(model)) &&
228+
row->child_rhs &&
229+
IS_RHS(row->child_rhs) &&
230+
(rhs = row->child_rhs)) {
231+
if (rhs &&
232+
rhs->itext &&
233+
ITEXT(rhs->itext)->edited)
229234
row_dirty_set_single(row, clear_error);
230-
else if (rhs && rhs->graphic &&
235+
else if (rhs &&
236+
rhs->graphic &&
231237
CLASSMODEL(rhs->graphic)->edited)
232238
row_dirty_set_single(row, clear_error);
233239
}

0 commit comments

Comments
 (0)