mirror of
https://github.com/KDE/kdeconnect-android
synced 2025-08-30 21:55:10 +00:00
Do not assume that all the plugins are non-null
This commit is contained in:
@@ -49,6 +49,7 @@ import org.kde.kdeconnect_tp.R;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.ConcurrentModificationException;
|
import java.util.ConcurrentModificationException;
|
||||||
|
import java.util.HashMap;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -321,7 +322,7 @@ public class DeviceFragment extends Fragment {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//Failed plugins List
|
//Failed plugins List
|
||||||
final Collection<Plugin> failed = device.getFailedPlugins().values();
|
final HashMap<String, Plugin> failed = device.getFailedPlugins();
|
||||||
if (!failed.isEmpty()) {
|
if (!failed.isEmpty()) {
|
||||||
if (errorHeader == null) {
|
if (errorHeader == null) {
|
||||||
errorHeader = new TextView(mActivity);
|
errorHeader = new TextView(mActivity);
|
||||||
@@ -336,13 +337,18 @@ public class DeviceFragment extends Fragment {
|
|||||||
errorHeader.setText(getResources().getString(R.string.plugins_failed_to_load));
|
errorHeader.setText(getResources().getString(R.string.plugins_failed_to_load));
|
||||||
}
|
}
|
||||||
items.add(new CustomItem(errorHeader));
|
items.add(new CustomItem(errorHeader));
|
||||||
for (final Plugin p : failed) {
|
for (String s : failed.keySet()) {
|
||||||
items.add(new SmallEntryItem(p.getDisplayName(), new View.OnClickListener() {
|
final Plugin p = failed.get(s);
|
||||||
@Override
|
if (p == null) {
|
||||||
public void onClick(View v) {
|
items.add(new SmallEntryItem(s));
|
||||||
p.getErrorDialog(mActivity).show();
|
} else {
|
||||||
}
|
items.add(new SmallEntryItem(p.getDisplayName(), new View.OnClickListener() {
|
||||||
}));
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
p.getErrorDialog(mActivity).show();
|
||||||
|
}
|
||||||
|
}));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user