Commit 8f0847af authored by George Vogiatzis's avatar George Vogiatzis Committed by Nate Graham

[Applet]Add port check

Add port check before port.description check.

Cannot check port.description if port does not exist.

Test Plan:
If there is a device with ports, and an other one without ports, will fail to display the name a device, or crash?

Name should be displayed correctly in every case.

Reviewers: #plasma, drosca, ngraham

Reviewed By: ngraham

Subscribers: plasma-devel

Tags: #plasma

Differential Revision:
parent e6a3111f
......@@ -39,7 +39,7 @@ ListItemBase {
if (i !== index) {
var port =, 0), model.role("Ports"))
[, 0), model.role("ActivePortIndex"))];
if (port.description) {
if (port && port.description) {
var length = Math.min(itemLength, port.description.length)
if (currentPort.description.substring(0, length) === port.description.substring(0, length)) {
return i18nc("label of device items", "%1 (%2)", currentPort.description, Description);
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment