2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 14:45:14 +00:00

0.9.59 alpha version: crash on logout fixed.

This commit is contained in:
John Preston
2016-07-23 09:39:46 +03:00
parent 26723fb820
commit 5b7a17e044
6 changed files with 22 additions and 16 deletions

View File

@@ -357,7 +357,13 @@ void AudioPlayer::onStopped(const AudioMsgId &audio) {
}
AudioPlayer::AudioMsg *AudioPlayer::dataForType(AudioMsgId::Type type, int index) {
if (index < 0) index = *currentIndex(type);
if (index < 0) {
if (auto indexPtr = currentIndex(type)) {
index = *indexPtr;
} else {
return nullptr;
}
}
switch (type) {
case AudioMsgId::Type::Voice: return &_audioData[index];
case AudioMsgId::Type::Song: return &_songData[index];