summaryrefslogtreecommitdiff
path: root/css/css.c
diff options
context:
space:
mode:
Diffstat (limited to 'css/css.c')
-rw-r--r--css/css.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/css/css.c b/css/css.c
index 3ba3da872..589f0cc78 100644
--- a/css/css.c
+++ b/css/css.c
@@ -919,9 +919,16 @@ void css_atimport_callback(content_msg msg, struct content *css,
#endif
/* todo: handle AUTH and SSL */
case CONTENT_MSG_ERROR:
- c->data.css.import_content[i] = 0;
- c->active--;
- content_add_error(c, "?", 0);
+ /* The stylesheet we were fetching may have been
+ * redirected, in that case, the object pointers
+ * will differ, so ensure that the object that's
+ * in error is still in use by us before invalidating
+ * the pointer */
+ if (c->data.css.import_content[i] == css) {
+ c->data.css.import_content[i] = 0;
+ c->active--;
+ content_add_error(c, "?", 0);
+ }
break;
case CONTENT_MSG_STATUS: