Skip to content

Commit

Permalink
Fix segfault when starting playback through the spotify app (#94)
Browse files Browse the repository at this point in the history
  • Loading branch information
skaupper authored Dec 18, 2019
1 parent 5129ba1 commit fdd4787
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/Spotify/SpotifyBackend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -175,8 +175,12 @@ TResult<std::optional<PlaybackTrack>> SpotifyBackend::getCurrentPlayback() {
return std::nullopt;
}

auto const &spotifyPlayingTrack =
playback.value().getCurrentPlayingTrack().value();
auto const &spotifyPlayingTrackOpt =
playback.value().getCurrentPlayingTrack();
if (!spotifyPlayingTrackOpt.has_value()) {
return std::nullopt;
}
auto const &spotifyPlayingTrack = spotifyPlayingTrackOpt.value();

PlaybackTrack playbackTrack;
playbackTrack.trackId = spotifyPlayingTrack.getUri();
Expand Down

0 comments on commit fdd4787

Please sign in to comment.