Skip to content

Commit

Permalink
Merge pull request #13 from wikisource/no-key
Browse files Browse the repository at this point in the history
Check for data path before using
  • Loading branch information
samwilson authored Jan 31, 2023
2 parents 8cedfd1 + 991b33d commit e3a60b8
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Wikisource.php
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,10 @@ public function sendApiRequest( FluentRequest $request, $resultKey ) {
// Send request and save data for later returning.
$this->logger->debug( "API request: " . json_encode( $request->getParams() ) );
$result = new Data( $this->getMediawikiApi()->getRequest( $request ) );
if ( !$result->has( $resultKey ) ) {
$continue = false;
continue;
}
$resultingData = $result->get( $resultKey );
if ( !is_array( $resultingData ) ) {
$continue = false;
Expand Down

0 comments on commit e3a60b8

Please sign in to comment.