1
0
mirror of https://github.com/wulkanowy/wulkanowy.git synced 2024-11-23 18:16:06 -06:00

Avoid null if cell second div not contain span (#118)

This commit is contained in:
Mikołaj Pich 2018-05-23 18:44:04 +02:00 committed by Rafał Borcz
parent 9c97962e89
commit 859f8dc319
3 changed files with 17 additions and 3 deletions

View File

@ -98,8 +98,10 @@ public class Timetable {
addLessonInfoFromElement(lesson, e.first()); addLessonInfoFromElement(lesson, e.first());
break; break;
case 2: case 2:
Element span = e.last().select("span").first(); Element span = e.last().selectFirst("span");
if (span.hasClass(LessonTypes.CLASS_MOVED_OR_CANCELED)) { if (null == span) {
addLessonInfoFromElement(lesson, e.first());
} else if (span.hasClass(LessonTypes.CLASS_MOVED_OR_CANCELED)) {
lesson.setNewMovedInOrChanged(true); lesson.setNewMovedInOrChanged(true);
lesson.setDescription("poprzednio: " + getLessonAndGroupInfoFromSpan(span)[0]); lesson.setDescription("poprzednio: " + getLessonAndGroupInfoFromSpan(span)[0]);
addLessonInfoFromElement(lesson, e.first()); addLessonInfoFromElement(lesson, e.first());

View File

@ -105,6 +105,7 @@ public class TimetableTest extends StudentAndParentTestCase {
Assert.assertEquals("Zajęcia techniczne", std.getWeekTable().getDay(2).getLesson(4).getSubject()); Assert.assertEquals("Zajęcia techniczne", std.getWeekTable().getDay(2).getLesson(4).getSubject());
Assert.assertEquals("Wychowanie fizyczne", std.getWeekTable().getDay(1).getLesson(1).getSubject()); Assert.assertEquals("Wychowanie fizyczne", std.getWeekTable().getDay(1).getLesson(1).getSubject());
Assert.assertEquals("Język angielski", full.getWeekTable().getDay(0).getLesson(1).getSubject()); Assert.assertEquals("Język angielski", full.getWeekTable().getDay(0).getLesson(1).getSubject());
Assert.assertEquals("Wychowanie fizyczne", full.getWeekTable().getDay(0).getLesson(9).getSubject());
Assert.assertEquals("Wychowanie do życia w rodzinie", full.getWeekTable().getDay(2).getLesson(0).getSubject()); Assert.assertEquals("Wychowanie do życia w rodzinie", full.getWeekTable().getDay(2).getLesson(0).getSubject());
Assert.assertEquals("Wychowanie fizyczne", full.getWeekTable().getDay(3).getLesson(1).getSubject()); Assert.assertEquals("Wychowanie fizyczne", full.getWeekTable().getDay(3).getLesson(1).getSubject());
Assert.assertEquals("Uroczyste zakończenie roku szkolnego", full.getWeekTable().getDay(4).getLesson(0).getSubject()); Assert.assertEquals("Uroczyste zakończenie roku szkolnego", full.getWeekTable().getDay(4).getLesson(0).getSubject());

View File

@ -461,7 +461,18 @@
<tr> <tr>
<td>9</td> <td>9</td>
<td>14:50 15:35</td> <td>14:50 15:35</td>
<td></td> <td>
<div>
<span class="x-treelabel-ppl x-treelabel-zas">Wychowanie fizyczne [zaw2]</span>
<span class="x-treelabel-ppl x-treelabel-zas"></span>
<span class="x-treelabel-ppl x-treelabel-zas"></span>
<span class="x-treelabel-ppl x-treelabel-zas">G3</span>
<span class="x-treelabel-rlz">(przeniesiona z lekcji 7, 01.12.2017)</span>
</div>
<div>
<!--<span>WTF</span>-->
</div>
</td>
<td> <td>
<div> <div>
<span class="x-treelabel-ppl x-treelabel-inv">Język niemiecki [J1]</span> <span class="x-treelabel-ppl x-treelabel-inv">Język niemiecki [J1]</span>