gnosygnu / xowa

xowa offline wiki application
Other
379 stars 40 forks source link

Missing wikidata enities #773

Closed desb42 closed 4 years ago

desb42 commented 4 years ago

Over time, some entries in www.wikidata.org have been deleted, but references to them remain

Examples are: Q50 www.wikidata.org/wiki/Wikidata:SPARQL_query_service/queries/examples and P5660 fr.wikipedia.org/wiki/Wikipédia:Ateliers_Bases/Recherche

These references, when referred to cause NullPointerException

I have identified two places where a reference is expected but not handled if it does not exist

400_xowa\src\gplx\xowa\mediawiki\extensions\Wikibase\client\includes\dataAccess\scribunto\Wbase_entity_accessor.java Line 36 checks for an entity (or null) Line 55 tries to use this entity - but its null and blows up Adding at line 42

if (entity == null) return null; // nothing found

stops the error

similarly 400_xowa\src\gplx\xowa\mediawiki\extensions\Wikibase\lib\includes\Store\XomwEntityRetrievingTermLookup.java Line 26 checks for an entity (or null) Line 27 tries to use this entity - but its null and blows up Adding at line 27

if (entity == null) return null; // nothing found

stops the error

gnosygnu commented 4 years ago

Cool. Instructions look simple enough.

I'm working on the Wikidata Lexeme issue #771 , but will add this to In Progress queue.

Thanks!

gnosygnu commented 4 years ago

Fixed with the commit above. No tests, but changes are simple enough. Thanks again for the outline!