summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Userland/Applications/SoundPlayer/Player.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/Userland/Applications/SoundPlayer/Player.cpp b/Userland/Applications/SoundPlayer/Player.cpp
index 41c874cdd0..fcc5a2d09d 100644
--- a/Userland/Applications/SoundPlayer/Player.cpp
+++ b/Userland/Applications/SoundPlayer/Player.cpp
@@ -155,7 +155,11 @@ void Player::toggle_mute()
void Player::seek(int sample)
{
- sample *= (m_playback_manager.device_sample_rate() / static_cast<float>(m_playback_manager.loader()->sample_rate()));
+ auto loader = m_playback_manager.loader();
+ if (loader.is_null()) {
+ return;
+ }
+ sample *= (m_playback_manager.device_sample_rate() / static_cast<float>(loader->sample_rate()));
m_playback_manager.seek(sample);
}