Page MenuHomePhabricator

Uncaught TypeError: Cannot read property 'toLowerCase' of null
Closed, ResolvedPublic

Description

Error counts between 2016-05-18 20:33:39 and 2016-05-24 17:15:38, for this and similar error messages:

51 Uncaught TypeError: Cannot read property 'toLowerCase' of null
13 Unable to get property 'toLowerCase' of undefined or null reference
 6 TypeError: null is not an object (evaluating 'extension.toLowerCase')
 1 No se puede obtener la propiedad 'toLowerCase' de referencia nula o sin definir

Event Timeline

UW has 'extension.toLowerCase' in only two places, and in both we definitely correctly check for null. There is an 'extension.toLowerCase' also in mw.Title.normalizeExtension. We use that in a few places, but they all should be at points where only files with valid extensions can appear.

Huh… apparently Commons has some redirects in the File namespace without an extension, for example https://commons.wikimedia.org/w/index.php?title=File:2010-02-19_16500x2000_chicago&redirect=no or https://commons.wikimedia.org/w/index.php?title=File:Antigua_escuela_de_Tresgrandas&redirect=no. When they pop up in the API result in DestinationChecker, this exception happens.

Change 292336 had a related patch set uploaded (by Bartosz Dziewoński):
mw.DestinationChecker: Avoid exception when a file page without extension is returned

https://gerrit.wikimedia.org/r/292336

matmarex triaged this task as Medium priority.

Change 292336 merged by jenkins-bot:
mw.DestinationChecker: Avoid exception when a file page without extension is returned

https://gerrit.wikimedia.org/r/292336

matmarex removed a project: Patch-For-Review.

I think that was the only source of these. We'll find out for certain next week when it's deployed.

Last 10 days:

76	Uncaught TypeError: Cannot read property 'toLowerCase' of null
23	TypeError: extension is null

Change 297120 had a related patch set uploaded (by Bartosz Dziewoński):
Set 'group' => 'ext.uploadWizard' for all our modules

https://gerrit.wikimedia.org/r/297120

Change 297120 merged by jenkins-bot:
Set 'group' => 'ext.uploadWizard' for all our modules

https://gerrit.wikimedia.org/r/297120

None of the remaining results are logged with event_url like '%ext.uploadWizard%', and I already went through UploadWizard with a fine comb twice, so I am confident these are not coming from our code.