**Steps to replicate the issue** (include links if applicable):
* `repr(pywikibot.Claim(site, "P31"))`
**What happens?**:
```
File "<input>", line 1, in <module>
File "/Users/User/.local/share/virtualenvs/wikidata-bot-framework-Uh4zljqI/lib/python3.10/site-packages/pywikibot/page/_wikibase.py", line 1437, in __repr__
repr(self.repo), self.toJSON(), cls_name=type(self).__name__)
File "/Users/User/.local/share/virtualenvs/wikidata-bot-framework-Uh4zljqI/lib/python3.10/site-packages/pywikibot/page/_wikibase.py", line 1605, in toJSON
data['mainsnak']['datavalue'] = self._formatDataValue()
File "/Users/User/.local/share/virtualenvs/wikidata-bot-framework-Uh4zljqI/lib/python3.10/site-packages/pywikibot/page/_wikibase.py", line 1924, in _formatDataValue
'value': self._formatValue(),
File "/Users/User/.local/share/virtualenvs/wikidata-bot-framework-Uh4zljqI/lib/python3.10/site-packages/pywikibot/page/_wikibase.py", line 1896, in _formatValue
value = {'entity-type': self.getTarget().entity_type,
AttributeError: 'NoneType' object has no attribute 'entity_type'
```
**What should have happened instead?**: A repr of some sort should show up
**Software version** (skip for WMF-hosted wikis like Wikipedia):
**Other information** (browser name/version, screenshots, etc.):