Hoo man has uploaded a new change for review.

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

Change subject: Handle missing descriptions gracefully
......................................................................

Handle missing descriptions gracefully

Bug: T125954
Change-Id: I4a3f848065425216610d5ce3ef391709d89ae7f1
---
M includes/Lua/mw.ext.articlePlaceholder.entityRenderer.lua
1 file changed, 7 insertions(+), 1 deletion(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/ArticlePlaceholder 
refs/changes/35/268635/1

diff --git a/includes/Lua/mw.ext.articlePlaceholder.entityRenderer.lua 
b/includes/Lua/mw.ext.articlePlaceholder.entityRenderer.lua
index c027682..a0dbe05 100644
--- a/includes/Lua/mw.ext.articlePlaceholder.entityRenderer.lua
+++ b/includes/Lua/mw.ext.articlePlaceholder.entityRenderer.lua
@@ -221,7 +221,13 @@
 -- @param String entityId
 -- @return String description
 local function descriptionRenderer( entityId )
-  return '<div class="articleplaceholer-description"><p>' .. 
mw.wikibase.description( entityId ) .. '</p></div>'
+  local description = mw.wikibase.description( entityId )
+
+  if description ~= nil then
+    return '<div class="articleplaceholer-description"><p>' .. 
mw.wikibase.description( entityId ) .. '</p></div>'
+  else
+    return ''
+  end
 end
 
 -- Render an entity, method to call all renderer

-- 
To view, visit https://gerrit.wikimedia.org/r/268635
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I4a3f848065425216610d5ce3ef391709d89ae7f1
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/ArticlePlaceholder
Gerrit-Branch: master
Gerrit-Owner: Hoo man <h...@online.de>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to