Solving a segfault with the newline_command when no window was openned

This commit is contained in:
Anonymus Raccoon
2020-05-21 15:10:36 +02:00
parent b76d01c1b5
commit e53c52b32a
+2 -1
View File
@@ -69,7 +69,8 @@ int newline_command(int key, buffer_t *buffer, env_t *env)
my_nresume(env->window);
buffer->buffer[0] = '\0';
buffer->pos = 0;
my_getcuryx(&env->window->y, &env->window->x);
if (env->window)
my_getcuryx(&env->window->y, &env->window->x);
}
if (env->window && ret >= 0)
prompt_prepare(buffer, env);