Fix of NPE when schedule is empty