@@ -307,46 +307,48 @@ row_error_set(Row *row)
307307void
308308row_error_clear (Row * row )
309309{
310- workspace_error_sanity ( row -> ws ) ;
310+ Workspace * ws = row -> ws ;
311311
312- if (row -> err ) {
313- Workspace * ws = row -> ws ;
312+ if (ws ) {
313+ workspace_error_sanity ( row -> ws ) ;
314314
315- ws -> errors = g_slist_remove (ws -> errors , row );
316- row -> err = FALSE;
315+ if (row -> err ) {
316+ ws -> errors = g_slist_remove (ws -> errors , row );
317+ row -> err = FALSE;
317318
318- iobject_changed (IOBJECT (row ));
319+ iobject_changed (IOBJECT (row ));
319320
320321#ifdef DEBUG_ERROR
321- printf ("row_error_clear: " );
322- row_name_print (row );
323- printf ("\n" );
322+ printf ("row_error_clear: " );
323+ row_name_print (row );
324+ printf ("\n" );
324325#endif /*DEBUG_ERROR*/
325326
326- /* Mark our text modified to make sure we reparse and compile.
327- * The code may contain pointers to dead symbols if we were in
328- * error because they were undefined.
329- */
330- if (row -> child_rhs &&
331- row -> child_rhs -> itext )
332- heapmodel_set_modified (HEAPMODEL (row -> child_rhs -> itext ), TRUE);
327+ /* Mark our text modified to make sure we reparse and compile.
328+ * The code may contain pointers to dead symbols if we were in
329+ * error because they were undefined.
330+ */
331+ if (row -> child_rhs &&
332+ row -> child_rhs -> itext )
333+ heapmodel_set_modified (HEAPMODEL (row -> child_rhs -> itext ), TRUE);
333334
334- /* All errors gone? Ws changed too.
335- */
336- if (!ws -> errors )
337- iobject_changed (IOBJECT (ws ));
335+ /* All errors gone? Ws changed too.
336+ */
337+ if (!ws -> errors )
338+ iobject_changed (IOBJECT (ws ));
338339
339- /* Is this a local row? Clear the top row error as well, in
340- * case it's in error because of us.
341- */
342- if (row != row -> top_row &&
343- row -> top_row -> expr ) {
344- expr_error_clear (row -> top_row -> expr );
345- row_dirty_set (row -> top_row , TRUE);
340+ /* Is this a local row? Clear the top row error as well, in
341+ * case it's in error because of us.
342+ */
343+ if (row != row -> top_row &&
344+ row -> top_row -> expr ) {
345+ expr_error_clear (row -> top_row -> expr );
346+ row_dirty_set (row -> top_row , TRUE);
347+ }
346348 }
347- }
348349
349- workspace_error_sanity (row -> ws );
350+ workspace_error_sanity (row -> ws );
351+ }
350352}
351353
352354/* Break a dependency.
0 commit comments