v5 Develop Fixed: Setup error because setting table does not exist (#6390)

* Fixed missing oauth tables during setup.

* Merge remote-tracking branch 'snipe-it-upstream/develop' into develop

* Merge remote-tracking branch 'snipe-it-upstream/develop' into develop



Merge remote-tracking branch 'origin/develop' into develop

* Fixed error during setup when settings table is not present
This commit is contained in:
Wes Hulette 2018-11-02 15:23:41 -04:00 committed by snipe
parent 88b1da4260
commit 0d2eef5894

View file

@ -103,12 +103,17 @@ class Setting extends Model
*
* @since 5.0.0
*
* @return \App\Models\Setting
* @return \App\Models\Setting|null
*/
public static function getSettings()
public static function getSettings(): ?Setting
{
return Cache::rememberForever(self::APP_SETTINGS_KEY, function () {
return self::first();
// Need for setup as no tables exist
try {
return self::first();
} catch (\Throwable $th) {
return null;
}
});
}