Skip to content

Commit

Permalink
Generate exception when no map providers enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
ddrury committed Jan 19, 2022
1 parent 648a131 commit bd8cff9
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions app/Services/LeafletJsService.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

namespace Fisharebest\Webtrees\Services;

use Fisharebest\Webtrees\Http\Exceptions\HttpServiceUnavailableException;
use Fisharebest\Webtrees\I18N;
use Fisharebest\Webtrees\Module\ModuleMapProviderInterface;

Expand Down Expand Up @@ -58,6 +59,10 @@ public function config(): object
})
->values();

if($map_providers->isEmpty()) {
throw new HttpServiceUnavailableException(I18N::translate('No map providers enabled.'));
}

return (object) [
'i18n' => [
'reset' => I18N::translate('Reload map'),
Expand Down

0 comments on commit bd8cff9

Please sign in to comment.