Tamslo has submitted this change and it was merged.
Change subject: add check for somevalue that caused crash in
diffWithinRangeChecker
......................................................................
add check for somevalue that caused crash in diffWithinRangeChecker
Change-Id: Ib4d77406e4d2931dab88fffccdcab3e285e9e5c1
---
M includes/ConstraintCheck/Checker/DiffWithinRangeChecker.php
1 file changed, 4 insertions(+), 0 deletions(-)
Approvals:
Tamslo: Verified; Looks good to me, approved
diff --git a/includes/ConstraintCheck/Checker/DiffWithinRangeChecker.php
b/includes/ConstraintCheck/Checker/DiffWithinRangeChecker.php
index 50c8083..eaf46ae 100755
--- a/includes/ConstraintCheck/Checker/DiffWithinRangeChecker.php
+++ b/includes/ConstraintCheck/Checker/DiffWithinRangeChecker.php
@@ -104,6 +104,10 @@
* error handling:
* types of this and the other value have to
be equal, both must contain actual values
*/
+ if ( !$mainSnak instanceof PropertyValueSnak ) {
+ $message = 'Referenced property needs
to have a value.';
+ return new CheckResult( $statement,
$constraint->getConstraintTypeQid(), $parameters,
CheckResult::STATUS_VIOLATION, $message );
+ }
if ( $mainSnak->getDataValue()->getType() ===
$dataValue->getType() && $mainSnak->getType() === 'value' ) {
$thatValue =
$this->rangeCheckerHelper->getComparativeValue( $mainSnak->getDataValue() );
--
To view, visit https://gerrit.wikimedia.org/r/217252
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Ib4d77406e4d2931dab88fffccdcab3e285e9e5c1
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/WikidataQualityConstraints
Gerrit-Branch: v1
Gerrit-Owner: Jonaskeutel <[email protected]>
Gerrit-Reviewer: Tamslo <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits