Merge branch 'master' into blender2.8
[blender.git] / source / blender / editors / space_sequencer / sequencer_edit.c
index d82028ef2c9ba914c0e7933e4e34de747bddcb33..999e0fbf2a4d51b53628549c5b977fd13566e80b 100644 (file)
@@ -3865,13 +3865,14 @@ void SEQUENCER_OT_change_path(struct wmOperatorType *ot)
 
 static int sequencer_export_subtitles_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event))
 {
+       Main *bmain = CTX_data_main(C);
        if (!RNA_struct_property_is_set(op->ptr, "filepath")) {
                char filepath[FILE_MAX];
 
-               if (G.main->name[0] == 0)
+               if (bmain->name[0] == '\0')
                        BLI_strncpy(filepath, "untitled", sizeof(filepath));
                else
-                       BLI_strncpy(filepath, G.main->name, sizeof(filepath));
+                       BLI_strncpy(filepath, bmain->name, sizeof(filepath));
 
                BLI_replace_extension(filepath, sizeof(filepath), ".srt");
                RNA_string_set(op->ptr, "filepath", filepath);