diff --git a/libr/cons/cons.c b/libr/cons/cons.c index 913f620203..aa2bbcc501 100644 --- a/libr/cons/cons.c +++ b/libr/cons/cons.c @@ -306,7 +306,7 @@ R_API void r_cons_break_clear(void) { } R_API void r_cons_context_break_push(RConsContext *context, RConsBreak cb, void *user, bool sig) { - if (!context->break_stack) { + if (!context || !context->break_stack) { return; } @@ -333,7 +333,7 @@ R_API void r_cons_context_break_push(RConsContext *context, RConsBreak cb, void } R_API void r_cons_context_break_pop(RConsContext *context, bool sig) { - if (!context->break_stack) { + if (!context || !context->break_stack) { return; } //restore old state @@ -381,7 +381,7 @@ R_API bool r_cons_is_breaked(void) { I.timeout = 0; } } - return I.context->breaked; + return I.context && I.context->breaked; } R_API void r_cons_line(int x, int y, int x2, int y2, int ch) {