Verified Commit e83473b6 authored by Rinigus Saar's avatar Rinigus Saar Committed by Jonah Brüchert
Browse files

handle null object cases on tab removal

parent f476c611
......@@ -132,7 +132,7 @@ Kirigami.ScrollablePage {
}
width: itemWidth
text: tabs.itemAt(index).title
text: tabs.itemAt(index) != null ? tabs.itemAt(index).title : ""
elide: Qt.ElideRight
}
......
......@@ -89,22 +89,22 @@ WebEngineView {
id: contextMenu
Controls.MenuItem {
enabled: contextMenu.request != null && (contextMenu.request.editFlags & ContextMenuRequest.CanCopy) != 0
text: i18n("Copy")
enabled: (contextMenu.request.editFlags & ContextMenuRequest.CanCopy) != 0
onTriggered: webEngineView.triggerWebAction(WebEngineView.Copy)
}
Controls.MenuItem {
enabled: contextMenu.request != null && (contextMenu.request.editFlags & ContextMenuRequest.CanCut) != 0
text: i18n("Cut")
enabled: (contextMenu.request.editFlags & ContextMenuRequest.CanCut) != 0
onTriggered: webEngineView.triggerWebAction(WebEngineView.Cut)
}
Controls.MenuItem {
enabled: contextMenu.request != null && (contextMenu.request.editFlags & ContextMenuRequest.CanPaste) != 0
text: i18n("Paste")
enabled: (contextMenu.request.editFlags & ContextMenuRequest.CanPaste) != 0
onTriggered: webEngineView.triggerWebAction(WebEngineView.Paste)
}
Controls.MenuItem {
enabled: contextMenu.request.linkUrl !== ""
enabled: contextMenu.request != null && contextMenu.request.linkUrl !== ""
text: i18n("Copy Url")
onTriggered: webEngineView.triggerWebAction(WebEngineView.CopyLinkToClipboard)
}
......@@ -117,7 +117,7 @@ WebEngineView {
onTriggered: webEngineView.triggerWebAction(WebEngineView.DownloadLinkToDisk)
}
Controls.MenuItem {
enabled: contextMenu.request.linkUrl !== ""
enabled: contextMenu.request != null && contextMenu.request.linkUrl !== ""
text: i18n("Open in new Tab")
onTriggered: webEngineView.triggerWebAction(WebEngineView.OpenLinkInNewTab)
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment