Fix NPE
This commit is contained in:
parent
6b8b0af8cd
commit
5dc17355b3
@ -1,5 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="GradleMigrationSettings" migrationVersion="1" />
|
||||
<component name="GradleSettings">
|
||||
<option name="linkedExternalProjectsSettings">
|
||||
<GradleProjectSettings>
|
||||
|
@ -1,4 +1,3 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ExternalStorageConfigurationManager" enabled="true" />
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_17" default="true" project-jdk-name="jbr-17" project-jdk-type="JavaSDK">
|
||||
|
@ -7,6 +7,7 @@ import com.thebrokenrail.mtudining.api.method.Periods;
|
||||
import com.thebrokenrail.mtudining.util.Category;
|
||||
import com.thebrokenrail.mtudining.util.Constants;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
|
||||
/**
|
||||
@ -41,6 +42,9 @@ public class MenuTask extends Task<MenuData> {
|
||||
// Loaded Periods
|
||||
|
||||
// Sort Periods/Meals
|
||||
if (periodsResponse.periods == null) {
|
||||
periodsResponse.periods = Collections.emptyList();
|
||||
}
|
||||
periodsResponse.periods.sort(Comparator.comparingInt(a -> a.sort_order));
|
||||
|
||||
// Load Menu For Each Period
|
||||
|
Loading…
Reference in New Issue
Block a user