]> wimlib.net Git - wimlib/blobdiff - src/write.c
write.c: Fix handling of NULL context in stream_filtered()
[wimlib] / src / write.c
index 91954f9f023b66f6fd96f122bd117ab86e58e2f7..39e8bd0af5a8c75002cb47c17fbd524e0529e694 100644 (file)
@@ -102,12 +102,15 @@ static int
 stream_filtered(const struct wim_lookup_table_entry *lte,
                const struct filter_context *ctx)
 {
-       int write_flags = ctx->write_flags;
-       WIMStruct *wim = ctx->wim;
+       int write_flags;
+       WIMStruct *wim;
 
        if (ctx == NULL)
                return 0;
 
+       write_flags = ctx->write_flags;
+       wim = ctx->wim;
+
        if (write_flags & WIMLIB_WRITE_FLAG_OVERWRITE &&
            lte->resource_location == RESOURCE_IN_WIM &&
            lte->rspec->wim == wim)