Extra NULL checks

This commit is contained in:
Mattias Eriksson 2018-04-25 21:25:29 +02:00
parent 913dd235ee
commit 1d115ddca9

View file

@ -51,9 +51,11 @@ bool have_lock() {
struct sway_layer_surface *sway_layer; struct sway_layer_surface *sway_layer;
wl_list_for_each_reverse(sway_layer, layers, link) { wl_list_for_each_reverse(sway_layer, layers, link) {
struct wlr_layer_surface *surface = sway_layer->layer_surface; struct wlr_layer_surface *surface = sway_layer->layer_surface;
if (!strcmp("lockscreen", surface->namespace)) if (surface != NULL && surface->namespace != NULL) {
wlr_log(L_DEBUG, "Lockscreen found!"); if (!strcmp("lockscreen", surface->namespace))
return true; wlr_log(L_DEBUG, "Lockscreen found!");
return true;
}
} }
} }