mirror of
https://github.com/TimeCrafters/TimeCraftersConfigurationTool.git
synced 2025-12-15 05:02:33 +00:00
Updates, fixed crash when packet handler was handling listConfigs where the list of configs was empty
This commit is contained in:
@@ -1,20 +1,18 @@
|
||||
package org.timecrafters.TimeCraftersConfigurationTool;
|
||||
|
||||
import android.app.Notification;
|
||||
import android.app.PendingIntent;
|
||||
import android.content.Intent;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
|
||||
import com.google.android.material.bottomnavigation.BottomNavigationView;
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.navigation.NavController;
|
||||
import androidx.navigation.Navigation;
|
||||
import androidx.navigation.ui.AppBarConfiguration;
|
||||
import androidx.navigation.ui.NavigationUI;
|
||||
|
||||
import com.google.android.material.bottomnavigation.BottomNavigationView;
|
||||
|
||||
import org.timecrafters.TimeCraftersConfigurationTool.backend.Backend;
|
||||
import org.timecrafters.TimeCraftersConfigurationTool.backend.TAC;
|
||||
import org.timecrafters.TimeCraftersConfigurationTool.tacnet.TACNETServerService;
|
||||
|
||||
@@ -14,6 +14,6 @@ public class TAC {
|
||||
|
||||
// Set COMPETITION_MODE to true to disable automatic TACNET server start
|
||||
public static final boolean BUILD_COMPETITION_MODE = false;
|
||||
public static final boolean BUILD_AUTO_START = true;
|
||||
public static final String BUILD_AUTO_START_MODEL = "pixel";// "rev hub"; /* LOWERCASE */
|
||||
public static final boolean BUILD_AUTO_START = false;
|
||||
public static final String BUILD_AUTO_START_MODEL = "rev hub"; /* LOWERCASE */
|
||||
}
|
||||
|
||||
@@ -67,6 +67,11 @@ public class PacketHandler {
|
||||
return;
|
||||
}
|
||||
|
||||
case SELECT_CONFIG: {
|
||||
handleSelectConfig(packet);
|
||||
return;
|
||||
}
|
||||
|
||||
case ADD_CONFIG: {
|
||||
handleAddConfig(packet);
|
||||
return;
|
||||
@@ -145,6 +150,11 @@ public class PacketHandler {
|
||||
ArrayList<String> diff = Backend.instance().configsList();
|
||||
|
||||
for (String part : remoteConfigs) {
|
||||
// Don't crash if configs list is empty
|
||||
if (part == null || part.length() == 0) {
|
||||
continue;
|
||||
}
|
||||
|
||||
final String[] configInfo = part.split(",", 2);
|
||||
final String name = configInfo[0];
|
||||
final int revision = Integer.parseInt(configInfo[1]);
|
||||
|
||||
Reference in New Issue
Block a user