Commit ccdeb932 authored by George Vogiatzis's avatar George Vogiatzis Committed by Nate Graham

[Applet]Supplementary add port check

Summary:
Supplementary to the previous commit.
2 More ports needs check. The issue is the same, maybe crash or
display warning, if the port does not exit when try to read description.

Reviewers: drosca, ngraham

Reviewed By: ngraham

Subscribers: plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D27086
parent 8f0847af
......@@ -32,7 +32,7 @@ ListItemBase {
draggable: false
label: {
if (currentPort) {
if (currentPort && currentPort.description) {
var model = type === "sink" ? paSinkModel : paSourceModel;
var itemLength = currentPort.description.length;
for (var i = 0; i < model.rowCount(); i++) {
......@@ -70,7 +70,7 @@ ListItemBase {
// Prevent an unavailable port selection. UI allows selection of an unavailable port, until it gets refresh,
// because there is no call from pulseaudio for availability change.
onActivePortIndexChanged: {
if (currentPort.availability === Port.Unavailable) {
if (currentPort && currentPort.availability === Port.Unavailable) {
for (var i = 0; i < Ports.length; i++) {
if (Ports[i].availability === Port.Available) {
ActivePortIndex = i;
......
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