diff --git a/kitty/screen.c b/kitty/screen.c index dc5a7415c..9c55fb263 100644 --- a/kitty/screen.c +++ b/kitty/screen.c @@ -1772,7 +1772,7 @@ screen_update_selection(Screen *self, index_type x, index_type y, bool ended) { break; } if (found) self->selection.end_x = end; - if (global_state.boss) call_boss(set_primary_selection, NULL); + call_boss(set_primary_selection, NULL); } static PyObject* diff --git a/kitty/state.h b/kitty/state.h index 99191a020..79e7352ac 100644 --- a/kitty/state.h +++ b/kitty/state.h @@ -137,7 +137,7 @@ typedef struct { extern GlobalState global_state; -#define call_boss(name, ...) { \ +#define call_boss(name, ...) if (global_state.boss) { \ PyObject *cret_ = PyObject_CallMethod(global_state.boss, #name, __VA_ARGS__); \ if (cret_ == NULL) { PyErr_Print(); } \ else Py_DECREF(cret_); \