Error: cannot read property 'replace' of null

Error: cannot read property 'replace' of null

av Péter Lukács -
Antal svar: 4

Moodle 3.5.2+, Mobile app 3.5.2. Airnotifier properly configured.

I used SAML2 SSO addon for authentication. After logged in, when i click on 'Notifications' the attacked 'Error: cannot read property 'replace' of null' error pops up.

I fixed this issue with removing the existing user and logging in as new... any clues?


Bilaga Screenshot_2018-09-19-13-03-46-273_com.moodle.moodlemobile.png
Medeltalet av utvärderingarna: -
Som svar till Péter Lukács

Re: Error: cannot read property 'replace' of null

av Dani Palou -
Bild av Core developers Bild av Moodle HQ Bild av Particularly helpful Moodlers Bild av Peer reviewers Bild av Plugin developers

Hi Péter,

I looked at the code and there are several places where we call 'replace', but I think that the one that affected you could be this one:

notification.mobiletext.replace(/-{4,}/ig, '');

Maybe the app didn't receive the "mobiletext" property of one notification? It's  weird that it was fixed by removing the data :/

Cheers,

Dani

Medeltalet av utvärderingarna: -
Som svar till Dani Palou

Re: Error: cannot read property 'replace' of null

av ARTEAGA Rodrigo -
I have the exact same issue. Just installed the mobile app and was working fine. I hope to find a few answers.
Medeltalet av utvärderingarna: -
Som svar till ARTEAGA Rodrigo

Re: Error: cannot read property 'replace' of null

av Dani Palou -
Bild av Core developers Bild av Moodle HQ Bild av Particularly helpful Moodlers Bild av Peer reviewers Bild av Plugin developers
Hi Rodrigo,

Does this happen in a custom app but not in the official app?

When does the error appear exactly?

Cheers,
Dani
Medeltalet av utvärderingarna: -
Som svar till Dani Palou

Re: Error: cannot read property 'replace' of null

av ARTEAGA Rodrigo -

Hello Dani

I am using the official Moodle App. I just downloaded it to my Android, so it is updated. It worked one day and then on the second day, it began giving this error.   


I noticed that it appears when I click on reload button to check for new notifications. But it also happened when there were notifications and I clicked on the notification bell icon. 

Thank you very much for your help, 

Rodrigo



Medeltalet av utvärderingarna: -