We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5129ba1 commit fdd4787Copy full SHA for fdd4787
1 file changed
src/Spotify/SpotifyBackend.cpp
@@ -175,8 +175,12 @@ TResult<std::optional<PlaybackTrack>> SpotifyBackend::getCurrentPlayback() {
175
return std::nullopt;
176
}
177
178
- auto const &spotifyPlayingTrack =
179
- playback.value().getCurrentPlayingTrack().value();
+ auto const &spotifyPlayingTrackOpt =
+ playback.value().getCurrentPlayingTrack();
180
+ if (!spotifyPlayingTrackOpt.has_value()) {
181
+ return std::nullopt;
182
+ }
183
+ auto const &spotifyPlayingTrack = spotifyPlayingTrackOpt.value();
184
185
PlaybackTrack playbackTrack;
186
playbackTrack.trackId = spotifyPlayingTrack.getUri();
0 commit comments