make sure backend_data is not null

... before assigning to backend_data->ops in initialize_backend()

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
This commit is contained in:
Yuxuan Shui 2019-05-16 02:24:32 +01:00
parent 3cabba6161
commit 488db11f14
No known key found for this signature in database
GPG Key ID: 37C999F617EA1A47
1 changed files with 1 additions and 1 deletions

View File

@ -676,13 +676,13 @@ static bool initialize_backend(session_t *ps) {
assert(!ps->backend_data);
// Reinitialize win_data
ps->backend_data = backend_list[ps->o.backend]->init(ps);
ps->backend_data->ops = backend_list[ps->o.backend];
if (!ps->backend_data) {
log_fatal("Failed to initialize backend, aborting...");
ps->quit = true;
ev_break(ps->loop, EVBREAK_ALL);
return false;
}
ps->backend_data->ops = backend_list[ps->o.backend];
// window_stack shouldn't include window that's not in the hash table at
// this point. Since there cannot be any fading windows.