Bugfix for #3158464 "category.py add crashes on redirect"
Bugfix for #3158464 "category.py add crashes on redirect"

Patch for the rewrite branch and backport to trunk.

Bug was introduced in r8493 when splitting off 'category.py add' into a
separate class. This patch resolves the bug.

Created during the Amsterdam Hackathon.

https://mediawiki.org/wiki/Special:Code/pywikipedia/8830

npdoty/pywikibot,jayvdb/pywikibot-core,darthbhyrava/pywikibot-local,hasteur/g13bot_tools_new,hasteur/g13bot_tools_new,icyflame/batman,Darkdadaah/pywikibot-core,wikimedia/pywikibot-core,xZise/pywikibot-core,TridevGuha/pywikibot-core,valhallasw/pywikibot-core,happy5214/pywikibot-core,magul/pywikibot-core,trishnaguha/pywikibot-core,VcamX/pywikibot-core,wikimedia/pywikibot-core,Darkdadaah/pywikibot-core,magul/pywikibot-core,h4ck3rm1k3/pywikibot-core,hasteur/g13bot_tools_new,happy5214/pywikibot-core,jayvdb/pywikibot-core,emijrp/pywikibot-core,npdoty/pywikibot,PersianWikipedia/pywikibot-core,smalyshev/pywikibot-core,h4ck3rm1k3/pywikibot-core