Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Return value of getTenantIdByDomain() must be of the type string, null returned #349

Closed
jonagoldman opened this issue Apr 10, 2020 · 0 comments · Fixed by #350
Closed

Return value of getTenantIdByDomain() must be of the type string, null returned #349

jonagoldman opened this issue Apr 10, 2020 · 0 comments · Fixed by #350
Assignees
Labels
bug Something isn't working

Comments

@jonagoldman
Copy link
Contributor

Describe the bug

Calling Tenancy::findByDomain($domain) throws an exception if tenant not in cache and does't exist.

Expected behavior

TenantCouldNotBeIdentifiedException should be thrown instead.

Your setup

  • Laravel version: 7.5.2
  • stancl/tenancy version: 2.3.3
  • Storage driver: MySQL

Stacktrace

Return value of
Stancl\\Tenancy\\StorageDrivers\\Database\\CachedTenantResolver::getTenantIdByDomain()
must be of the type string, null returned at
/xxx/vendor/stancl/tenancy/src/StorageDrivers/Database/CachedTenantResolver.php:33)

# 0 /xxx/vendor/stancl/tenancy/src/StorageDrivers/Database/DatabaseStorageDriver.php(72):
Stancl\\Tenancy\\StorageDrivers\\Database\\CachedTenantResolver->getTenantIdByDomain()

# 1 /xxx/vendor/stancl/tenancy/src/TenantManager.php(220):
Stancl\\Tenancy\\StorageDrivers\\Database\\DatabaseStorageDriver->findByDomain()

# 2 /xxx/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php(261):
Stancl\\Tenancy\\TenantManager->findByDomain()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants