From aa6a981075d629393bd8f11f4953c65c183fa537 Mon Sep 17 00:00:00 2001 From: alberto Date: Mon, 26 Aug 2024 13:41:55 +0200 Subject: [PATCH] OPPIA-1643 - Add extra condition if tracker uuid is null --- .../oppia/utils/xmlreaders/CourseTrackerXMLReader.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/org/digitalcampus/oppia/utils/xmlreaders/CourseTrackerXMLReader.java b/app/src/main/java/org/digitalcampus/oppia/utils/xmlreaders/CourseTrackerXMLReader.java index 326670b98..ebb200bd7 100644 --- a/app/src/main/java/org/digitalcampus/oppia/utils/xmlreaders/CourseTrackerXMLReader.java +++ b/app/src/main/java/org/digitalcampus/oppia/utils/xmlreaders/CourseTrackerXMLReader.java @@ -33,6 +33,7 @@ import org.joda.time.DateTime; import org.w3c.dom.Document; import org.w3c.dom.NamedNodeMap; +import org.w3c.dom.Node; import org.w3c.dom.NodeList; import org.xml.sax.InputSource; import org.xml.sax.SAXException; @@ -98,8 +99,8 @@ public List getTrackers(Context ctx, long courseId, long userId) { NodeList actTrackers = document.getFirstChild().getChildNodes(); for (int i = 0; i < actTrackers.getLength(); i++) { NamedNodeMap attrs = actTrackers.item(i).getAttributes(); - String uuid = attrs.getNamedItem(NODE_UUID).getTextContent(); - if (uuidList.contains(uuid)) { + Node uuid = attrs.getNamedItem(NODE_UUID); + if (uuid != null && uuidList.contains(uuid.getTextContent())) { continue; }