Fix crash when previewing null AudioStream

This commit is contained in:
Poommetee Ketson 2018-08-22 17:03:51 +07:00
parent 3573d5f4ae
commit a327a0078b

View File

@ -169,7 +169,8 @@ Ref<AudioStreamPreview> AudioStreamPreviewGenerator::generate_preview(const Ref<
preview->preview->preview = maxmin;
preview->preview->length = len_s;
preview->thread = Thread::create(_preview_thread, preview);
if (preview->playback.is_valid())
preview->thread = Thread::create(_preview_thread, preview);
return preview->preview;
}