NPE clicking on a samigo link in lessons that has a duplicate alias

Description

SAK-43742 Samigo can show the wrong assessment where there are multiple ALIAS

was fixed, but following the test plan in that issue, I'm seeing that the patch causes an NPE to be thrown further downstream.

Activity

Show:

Austin February 7, 2022 at 6:43 PM

Before

there was already a null check on pub

but that commit added code above that null check so it’s never reached. While that’s an easy fix… it results in a blank page for the user. while that’s not as scary looking as a stack trace. it doesn’t provide any information. What would it take to display a proper error or redirect to an existing error page?

Austin February 5, 2022 at 12:56 AM

While the root cause of this is because of SAK-44276, I think it could be a while before that one is fixed. It would be good to fix this error so users don't hit a 500 error page.

Austin September 28, 2021 at 8:11 PM
Edited

I believe this exception is caused by SAK-41150, https://github.com/sakaiproject/sakai/commit/7a6b00637f1ba9618eb08b081a87ea24fb75e0fb

pub is null so the exception is thrown.  I'm not sure if there's a good way to avoid this. If there's a better way to get the siteId other than from .getPublishedAssessmentIdByAlias(alias), which I'm not sure if there is because the alias is the only id passed in via the URL.

I tried changing the order of the if (pub==null) check, so that it occurs right after the pub is set, which is how it was before the commit in SAK-41150, and that prevented the error, but the user still sees a blank screen... not as bad as an error, but without an error, it's harder for developers/admins to track down the problem to see if a duplicate alias is the cause. And I think the only way to fix it is to delete or change the bad alias manually from the database

Duplicate

Details

Priority

Components

Assignee

Reporter

Created July 7, 2021 at 4:48 PM
Updated February 7, 2022 at 6:43 PM
Resolved January 26, 2022 at 12:01 AM