@@ -387,20 +387,22 @@ void prep_rgb_status_animation(const pyexec_result_t* result,
387
387
if (!status -> ok ) {
388
388
status -> total_exception_cycle = EXCEPTION_TYPE_LENGTH_MS * 3 + LINE_NUMBER_TOGGLE_LENGTH * status -> digit_sum + LINE_NUMBER_TOGGLE_LENGTH * num_places ;
389
389
}
390
- if (mp_obj_is_subclass_fast (result -> exception_type , & mp_type_IndentationError )) {
391
- status -> exception_color = INDENTATION_ERROR ;
392
- } else if (mp_obj_is_subclass_fast (result -> exception_type , & mp_type_SyntaxError )) {
393
- status -> exception_color = SYNTAX_ERROR ;
394
- } else if (mp_obj_is_subclass_fast (result -> exception_type , & mp_type_NameError )) {
395
- status -> exception_color = NAME_ERROR ;
396
- } else if (mp_obj_is_subclass_fast (result -> exception_type , & mp_type_OSError )) {
397
- status -> exception_color = OS_ERROR ;
398
- } else if (mp_obj_is_subclass_fast (result -> exception_type , & mp_type_ValueError )) {
399
- status -> exception_color = VALUE_ERROR ;
400
- } else if (mp_obj_is_subclass_fast (result -> exception_type , & mp_type_MpyError )) {
401
- status -> exception_color = MPY_ERROR ;
402
- } else {
403
- status -> exception_color = OTHER_ERROR ;
390
+ if (result -> exception_type ) {
391
+ if (mp_obj_is_subclass_fast (result -> exception_type , & mp_type_IndentationError )) {
392
+ status -> exception_color = INDENTATION_ERROR ;
393
+ } else if (mp_obj_is_subclass_fast (result -> exception_type , & mp_type_SyntaxError )) {
394
+ status -> exception_color = SYNTAX_ERROR ;
395
+ } else if (mp_obj_is_subclass_fast (result -> exception_type , & mp_type_NameError )) {
396
+ status -> exception_color = NAME_ERROR ;
397
+ } else if (mp_obj_is_subclass_fast (result -> exception_type , & mp_type_OSError )) {
398
+ status -> exception_color = OS_ERROR ;
399
+ } else if (mp_obj_is_subclass_fast (result -> exception_type , & mp_type_ValueError )) {
400
+ status -> exception_color = VALUE_ERROR ;
401
+ } else if (mp_obj_is_subclass_fast (result -> exception_type , & mp_type_MpyError )) {
402
+ status -> exception_color = MPY_ERROR ;
403
+ } else {
404
+ status -> exception_color = OTHER_ERROR ;
405
+ }
404
406
}
405
407
#endif
406
408
}
0 commit comments