Merge pull request #21287 from Noshyaar/preview-crash

Fix crash when previewing null AudioStream
This commit is contained in:
Rémi Verschelde 2018-08-22 14:07:09 +02:00 committed by GitHub
commit a097fdfab1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

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