mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 23:50:19 +00:00
LibAudio: Make WavWriter
check if a file was set during destruction
`WavWriter` can be constructed without a file, which should probably be made impossible at some point. For now, let's not crash `Piano` when you close the application.
This commit is contained in:
parent
1c6c3685c4
commit
0f22dfa634
Notes:
sideshowbarker
2024-07-17 08:43:11 +09:00
Author: https://github.com/gmta Commit: https://github.com/SerenityOS/serenity/commit/0f22dfa634 Pull-request: https://github.com/SerenityOS/serenity/pull/18503
1 changed files with 1 additions and 1 deletions
|
@ -58,7 +58,7 @@ void WavWriter::finalize()
|
|||
VERIFY(!m_finalized);
|
||||
m_finalized = true;
|
||||
|
||||
if (m_file->is_open()) {
|
||||
if (m_file && m_file->is_open()) {
|
||||
auto result = [&]() -> ErrorOr<void> {
|
||||
TRY(m_file->seek(0, SeekMode::SetPosition));
|
||||
return TRY(write_header());
|
||||
|
|
Loading…
Reference in a new issue