mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Fixed possible rare crash from voice messages with ttl.
This commit is contained in:
parent
bb31357c58
commit
3b50bc71b3
2 changed files with 3 additions and 3 deletions
|
@ -346,7 +346,8 @@ Document::Document(
|
||||||
::Media::Player::instance()->tracksFinished(
|
::Media::Player::instance()->tracksFinished(
|
||||||
) | rpl::filter([=](AudioMsgId::Type type) {
|
) | rpl::filter([=](AudioMsgId::Type type) {
|
||||||
return (type == AudioMsgId::Type::Voice);
|
return (type == AudioMsgId::Type::Voice);
|
||||||
}) | rpl::to_empty
|
}) | rpl::to_empty,
|
||||||
|
::Media::Player::instance()->stops(AudioMsgId::Type::Voice)
|
||||||
) | rpl::start_with_next([=]() mutable {
|
) | rpl::start_with_next([=]() mutable {
|
||||||
_drawTtl = nullptr;
|
_drawTtl = nullptr;
|
||||||
const auto item = _parent->data();
|
const auto item = _parent->data();
|
||||||
|
@ -917,7 +918,7 @@ void Document::draw(
|
||||||
.highlight = highlightRequest ? &*highlightRequest : nullptr,
|
.highlight = highlightRequest ? &*highlightRequest : nullptr,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (_parent->data()->media()->ttlSeconds()) {
|
if (_parent->data()->media() && _parent->data()->media()->ttlSeconds()) {
|
||||||
const auto &fg = context.outbg
|
const auto &fg = context.outbg
|
||||||
? st::historyFileOutIconFg
|
? st::historyFileOutIconFg
|
||||||
: st::historyFileInIconFg;
|
: st::historyFileInIconFg;
|
||||||
|
|
|
@ -755,7 +755,6 @@ void MainWidget::handleAudioUpdate(const Media::Player::TrackState &state) {
|
||||||
const auto item = session().data().message(state.id.contextId());
|
const auto item = session().data().message(state.id.contextId());
|
||||||
if (!Media::Player::IsStoppedOrStopping(state.state)) {
|
if (!Media::Player::IsStoppedOrStopping(state.state)) {
|
||||||
const auto ttlSeconds = item
|
const auto ttlSeconds = item
|
||||||
&& !item->out()
|
|
||||||
&& item->media()
|
&& item->media()
|
||||||
&& item->media()->ttlSeconds();
|
&& item->media()->ttlSeconds();
|
||||||
if (!ttlSeconds) {
|
if (!ttlSeconds) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue