diff --git a/app/src/main/java/com/example/citrusclient/views/OtherCalendarFragment.java b/app/src/main/java/com/example/citrusclient/views/OtherCalendarFragment.java index 65dc5eb..a591b7e 100644 --- a/app/src/main/java/com/example/citrusclient/views/OtherCalendarFragment.java +++ b/app/src/main/java/com/example/citrusclient/views/OtherCalendarFragment.java @@ -185,12 +185,14 @@ @Override public void onChanged(HashMap> integerHashMapHashMap) { TextView curMonth = view.findViewById(R.id.otherMonth); - for (int day:integerHashMapHashMap.keySet()){ - if(todos.get(day) == null){ - todos.put(day, new HashMap<>()); - } - for(int todoId:integerHashMapHashMap.get(day).keySet()){ - todos.get(day).put(todoId, integerHashMapHashMap.get(day).get(todoId)); + if(integerHashMapHashMap != null && !integerHashMapHashMap.isEmpty()) { + for (int day : integerHashMapHashMap.keySet()) { + if (todos.get(day) == null) { + todos.put(day, new HashMap<>()); + } + for (int todoId : integerHashMapHashMap.get(day).keySet()) { + todos.get(day).put(todoId, integerHashMapHashMap.get(day).get(todoId)); + } } } updateCalendar(curMonth);