|
@@ -158,8 +158,10 @@ public class ServicesListAdapter extends ArrayAdapter<ServicesListItem> {
|
|
|
if(item.protocol.equals("GHOST")) {
|
|
|
mGhostPorts = mProfile.getGhostPorts();
|
|
|
for(Integer port: mGhostPorts){
|
|
|
- if(MainActivity.getInstance().getHostageService().isRunning("GHOST",port)){
|
|
|
- MainActivity.getInstance().getHostageService().stopListener("GHOST", port);
|
|
|
+ if(port != null) {
|
|
|
+ if(MainActivity.getInstance().getHostageService().isRunning("GHOST",port)){
|
|
|
+ MainActivity.getInstance().getHostageService().stopListener("GHOST", port);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
buttonView.setChecked(false);
|
|
@@ -188,10 +190,13 @@ public class ServicesListAdapter extends ArrayAdapter<ServicesListItem> {
|
|
|
mGhostPorts = mProfile.getGhostPorts();
|
|
|
|
|
|
boolean ghostActive = false;
|
|
|
-
|
|
|
- for(Integer port: mGhostPorts){
|
|
|
- if(MainActivity.getInstance().getHostageService().isRunning("GHOST",port)){
|
|
|
- ghostActive = true;
|
|
|
+ if(mGhostPorts.length != 0) {
|
|
|
+ for (Integer port : mGhostPorts) {
|
|
|
+ if(port != null){
|
|
|
+ if (MainActivity.getInstance().getHostageService().isRunning("GHOST", port)) {
|
|
|
+ ghostActive = true;
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
if(ghostActive){
|