mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-02-04 06:11:17 +00:00
fixed possible crash in playInline() call
This commit is contained in:
parent
eb728fb36e
commit
6220b88ae9
@ -860,14 +860,14 @@ void DocumentOpenLink::doOpen(DocumentData *data, ActionOnLoad action) {
|
||||
if (App::main()) App::main()->mediaMarkRead(data);
|
||||
} else if (data->size < MediaViewImageSizeLimit) {
|
||||
if (!data->data().isEmpty() && playAnimation) {
|
||||
if (action == ActionOnLoadPlayInline) {
|
||||
if (action == ActionOnLoadPlayInline && item->getMedia()) {
|
||||
item->getMedia()->playInline(item);
|
||||
} else {
|
||||
App::wnd()->showDocument(data, item);
|
||||
}
|
||||
} else if (location.accessEnable()) {
|
||||
if ((App::hoveredLinkItem() || App::contextItem()) && (data->isAnimation() || QImageReader(location.name()).canRead())) {
|
||||
if (action == ActionOnLoadPlayInline) {
|
||||
if (item && (data->isAnimation() || QImageReader(location.name()).canRead())) {
|
||||
if (action == ActionOnLoadPlayInline && item->getMedia()) {
|
||||
item->getMedia()->playInline(item);
|
||||
} else {
|
||||
App::wnd()->showDocument(data, item);
|
||||
@ -1143,7 +1143,7 @@ void DocumentData::performActionOnLoad() {
|
||||
}
|
||||
} else if (playAnimation) {
|
||||
if (loaded()) {
|
||||
if (_actionOnLoad == ActionOnLoadPlayInline) {
|
||||
if (_actionOnLoad == ActionOnLoadPlayInline && item->getMedia()) {
|
||||
item->getMedia()->playInline(item);
|
||||
} else {
|
||||
App::wnd()->showDocument(this, item);
|
||||
@ -1163,7 +1163,7 @@ void DocumentData::performActionOnLoad() {
|
||||
if (App::main()) App::main()->mediaMarkRead(this);
|
||||
} else if (loc.accessEnable()) {
|
||||
if (showImage && QImageReader(loc.name()).canRead()) {
|
||||
if (_actionOnLoad == ActionOnLoadPlayInline) {
|
||||
if (_actionOnLoad == ActionOnLoadPlayInline && item->getMedia()) {
|
||||
item->getMedia()->playInline(item);
|
||||
} else {
|
||||
App::wnd()->showDocument(this, item);
|
||||
|
Loading…
Reference in New Issue
Block a user