Trying to view lab information after respective modules are deleted results in NullPointer
Summary
Exactly what the title says.
Steps to reproduce
- Delete modules that an existing lab uses.
- Try to edit the lab as a teacher or go to the lab information page as a student.
Possible Fix
Get rid of existing module references when it is deleted, such as ALL associated assignments.
Logs
java.lang.NullPointerException: Cannot invoke "nl.tudelft.labracore.api.dto.AssignmentDetailsDTO.getModule()" because "a" is null
at nl.tudelft.queue.controller.LabController.lambda$setEnqueuePageAttributes$4(LabController.java:685)
at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:178)
at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1625)
at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:575)
at java.base/java.util.stream.AbstractPipeline.evaluateToArrayNode(AbstractPipeline.java:260)
at java.base/java.util.stream.ReferencePipeline.toArray(ReferencePipeline.java:616)
at java.base/java.util.stream.ReferencePipeline.toArray(ReferencePipeline.java:622)
at java.base/java.util.stream.ReferencePipeline.toList(ReferencePipeline.java:627)
at nl.tudelft.queue.controller.LabController.setEnqueuePageAttributes(LabController.java:688)
at nl.tudelft.queue.controller.LabController.getSessionView(LabController.java:136)
Edited by Henry Page