added fail check

This commit is contained in:
Rachel Lambda Samuelsson 2021-01-27 20:45:21 +01:00
parent 4aa0a6105c
commit 748c582e64

View File

@ -107,6 +107,7 @@ void imlib_update(char* path) {
if (!im_image) {
warn("Unable to open image");
printf("%s\n", im_image_path);
XClearWindow(xdisplay, xwindow);
return;
}
@ -122,6 +123,9 @@ void imlib_update(char* path) {
void imlib_render(int up_w, int up_h) {
if (!im_image || !im_image_path)
return;
imlib_blend_image_onto_image(im_image, 0,
0, 0, im_w, im_h,
0, 0, up_w, up_h);