mirror of
https://github.com/vale981/tdesktop
synced 2025-03-06 18:21:42 -05:00
fixed crash in links overview
This commit is contained in:
parent
afed48dd4a
commit
300164e61c
1 changed files with 3 additions and 2 deletions
|
@ -1120,7 +1120,8 @@ LayoutOverviewLink::LayoutOverviewLink(HistoryMedia *media, HistoryItem *parent)
|
|||
if (_page) {
|
||||
_title = _page->title;
|
||||
}
|
||||
QVector<QStringRef> parts = (_page ? _page->url : (_links.isEmpty() ? QString() : _links.at(0).lnk->text())).splitRef('/');
|
||||
QString url(_page ? _page->url : (_links.isEmpty() ? QString() : _links.at(0).lnk->text()));
|
||||
QVector<QStringRef> parts = url.splitRef('/');
|
||||
if (!parts.isEmpty()) {
|
||||
QStringRef domain = parts.at(0);
|
||||
if (parts.size() > 2 && domain.endsWith(':') && parts.at(1).isEmpty()) { // http:// and others
|
||||
|
@ -1278,4 +1279,4 @@ LayoutOverviewLink::Link::Link(const QString &url, const QString &text)
|
|||
: text(text)
|
||||
, width(st::normalFont->width(text))
|
||||
, lnk(linkFromUrl(url)) {
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue