aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/main.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/main.c b/src/main.c
index c609a07..3783ea5 100644
--- a/src/main.c
+++ b/src/main.c
@@ -86,7 +86,8 @@ void key_reload(){
}
void key_next(){
if(mode != MODE_CTL){
- curimg->state &= LOADED | SLOWLOADED;
+ if(curimg)
+ curimg->state &= LOADED | SLOWLOADED;
freeimage(previmg);
previmg = curimg;
curimg = nextimg;
@@ -100,7 +101,8 @@ void key_next(){
}
void key_prev(){
if(mode != MODE_CTL){
- curimg->state &= LOADED | SLOWLOADED;
+ if(curimg)
+ curimg->state &= LOADED | SLOWLOADED;
freeimage(nextimg);
nextimg = curimg;
curimg = previmg;