Fix segfault when set_shader() fails.