summaryrefslogtreecommitdiff
path: root/desktop/imagemap.c
diff options
context:
space:
mode:
Diffstat (limited to 'desktop/imagemap.c')
-rw-r--r--desktop/imagemap.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/desktop/imagemap.c b/desktop/imagemap.c
index ffc850d65..6bbb9a752 100644
--- a/desktop/imagemap.c
+++ b/desktop/imagemap.c
@@ -434,13 +434,15 @@ char *imagemap_get(struct content *c, const char *key, unsigned long x,
unsigned long cx, cy;
assert(c->type == CONTENT_HTML);
+ if (key == NULL) return NULL;
slot = imagemap_hash(key);
for (map = c->data.html.imagemaps[slot];
- map != 0 && strcasecmp(map->key, key) != 0;
- map = map->next)
- ;
+ map != 0; map = map->next) {
+ if (map->key != 0 && strcasecmp(map->key, key) == 0)
+ break;
+ }
if (map == 0) return NULL;