Skip to content

A free open source IT asset/license management system

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

Wes Hulette0d2eef58944d
diff --git a/app/Models/Setting.php b/app/Models/Setting.php
index 89ca0feff5..77d72d4138 100755
--- a/app/Models/Setting.php
+++ b/app/Models/Setting.php
@@ -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;
+ }
});
}