diff options
author | emersion <contact@emersion.fr> | 2018-07-13 23:15:10 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-07-13 23:15:10 +0100 |
commit | 4e486a01bb08120b3b02b5fed381a569dea3219e (patch) | |
tree | 62c6576a23287a317c6169ac7873fdfbdca04aa7 /swaybg/main.c | |
parent | e0e31418d413a16154e7487367a889c629783d1b (diff) | |
parent | c73a40555f41ad765c10ea5912525c56770e71d1 (diff) |
Merge pull request #2269 from minus7/swaybarbg-crash-on-dpms-resume
swaybar/bg: Fix crash on DPMS off
Diffstat (limited to 'swaybg/main.c')
-rw-r--r-- | swaybg/main.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/swaybg/main.c b/swaybg/main.c index 1796b245..f8e7e7ef 100644 --- a/swaybg/main.c +++ b/swaybg/main.c @@ -68,6 +68,9 @@ static void render_frame(struct swaybg_state *state) { buffer_height = state->height * state->scale; state->current_buffer = get_next_buffer(state->shm, state->buffers, buffer_width, buffer_height); + if (!state->current_buffer) { + return; + } cairo_t *cairo = state->current_buffer->cairo; if (state->args->mode == BACKGROUND_MODE_SOLID_COLOR) { cairo_set_source_u32(cairo, state->context.color); |