]> _ Git - fluidbook-toolbox.git/commitdiff
wait #6198 @0.5
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 17 Aug 2023 12:08:42 +0000 (14:08 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 17 Aug 2023 12:08:42 +0000 (14:08 +0200)
app/Models/FluidbookPublication.php

index d928c89d1b033e38da98f1b133104192cb886753..6885996fa837c8acb06011406ccd9913f45c5c66 100644 (file)
@@ -341,6 +341,9 @@ class FluidbookPublication extends ToolboxSettingsModel
         /** @var Company $company */
         if (null !== $owner) {
             $company = Company::withoutGlobalScopes()->find($owner->company);
+            if (null === $company) {
+                throw new \Exception('User ' . $this->owner . ' should be assign to a company');
+            }
 
             $this->admin = $company->admin;
             $this->super_admin = '';
@@ -975,9 +978,9 @@ class FluidbookPublication extends ToolboxSettingsModel
 
         if ($mobileFirst) {
             if ($sync) {
-                (new GenerateDeliveryThumbnailsPreview($mobileFirst,  'mobile'))->handle();
+                (new GenerateDeliveryThumbnailsPreview($mobileFirst, 'mobile'))->handle();
             } else {
-                dispatch(new GenerateDeliveryThumbnailsPreview($mobileFirst,  'mobile'))->onQueue('theme');
+                dispatch(new GenerateDeliveryThumbnailsPreview($mobileFirst, 'mobile'))->onQueue('theme');
             }
         }
 
@@ -985,8 +988,8 @@ class FluidbookPublication extends ToolboxSettingsModel
             (new GenerateDeliveryThumbnailsPreview($this))->handle();
             (new GenerateDeliveryThumbnailsPreview($this, 'mobile'))->handle();
         } else {
-            dispatch(new GenerateDeliveryThumbnailsPreview($this, ))->onQueue('theme');
-            dispatch(new GenerateDeliveryThumbnailsPreview($this,  'mobile'))->onQueue('theme');
+            dispatch(new GenerateDeliveryThumbnailsPreview($this,))->onQueue('theme');
+            dispatch(new GenerateDeliveryThumbnailsPreview($this, 'mobile'))->onQueue('theme');
         }
     }