Mholloway has uploaded a new change for review.
https://gerrit.wikimedia.org/r/266263
Change subject: Prevent TypeError when rewriting URL attributes
......................................................................
Prevent TypeError when rewriting URL attributes
Adds check to ensure the relevant variable is defined before further
processing.
Bug: T124458
Change-Id: Ibac0ab1d326241bab1ca7ddcfd4c3650a5acce87
---
M lib/transforms.js
1 file changed, 4 insertions(+), 2 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/services/mobileapps
refs/changes/63/266263/1
diff --git a/lib/transforms.js b/lib/transforms.js
index 720633c..38bd4dc 100644
--- a/lib/transforms.js
+++ b/lib/transforms.js
@@ -134,8 +134,10 @@
for (var idx = 0; idx < ps.length; idx++) {
var node = ps[idx];
value = node.getAttribute(attribute);
- value = value.replace(/^\.\//, '/wiki/');
- node.setAttribute(attribute, value);
+ if (value) {
+ value = value.replace(/^\.\//, '/wiki/');
+ node.setAttribute(attribute, value);
+ }
}
}
--
To view, visit https://gerrit.wikimedia.org/r/266263
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ibac0ab1d326241bab1ca7ddcfd4c3650a5acce87
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/services/mobileapps
Gerrit-Branch: master
Gerrit-Owner: Mholloway <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits