shithub: view

Download patch

ref: 3f239295d1fec3dbc03ce17acd66de9f0d81479f
parent: 18639defa53f4f513d8452cf4e9aaaee092f5ce7
author: phil9 <telephil9@gmail.com>
date: Fri Nov 26 02:14:30 EST 2021

prevent crash when using menu2 with no image loaded

--- a/view.c
+++ b/view.c
@@ -342,6 +342,8 @@
 	char buf[255];
 
 	n = sepmenuhit(2, mctl, &menu2, nil);
+	if(img == nil)
+		return;
 	switch(n){
 	case Mzoomin:
 	case Mzoomout: