Skip to content

Commit

Permalink
Use is_null
Browse files Browse the repository at this point in the history
  • Loading branch information
chinleung committed Aug 1, 2019
1 parent bbd4652 commit 177d45c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/helpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ function locales() : array
*/
function locale(string $locale = null) : string
{
if ($locale && in_array($locale, locales())) {
if (! is_null($locale) && in_array($locale, locales())) {
app()->setLocale($locale);
}

Expand Down

0 comments on commit 177d45c

Please sign in to comment.