File tree Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -384,7 +384,9 @@ public function backgroundColor($colorRGB)
384384 {
385385 // assume that 3 params were given instead of array
386386 if (!is_array ($ colorRGB )) {
387+ //phpcs:disable
387388 $ colorRGB = func_get_args ();
389+ //phpcs:enabled
388390 }
389391 $ this ->_getModel ()->setBackgroundColor ($ colorRGB );
390392 return $ this ;
@@ -498,7 +500,11 @@ protected function initBaseFile()
498500 if ($ this ->getImageFile ()) {
499501 $ model ->setBaseFile ($ this ->getImageFile ());
500502 } else {
501- $ model ->setBaseFile ($ this ->getProduct ()->getData ($ model ->getDestinationSubdir ()));
503+ $ model ->setBaseFile (
504+ $ this ->getProduct ()
505+ ? $ this ->getProduct ()->getData ($ model ->getDestinationSubdir ())
506+ : ''
507+ );
502508 }
503509 }
504510 return $ this ;
Original file line number Diff line number Diff line change @@ -396,6 +396,14 @@ public function testGetWidth()
396396 $ this ->assertEquals ($ data ['width ' ], $ this ->helper ->getWidth ());
397397 }
398398
399+ /**
400+ * Check initBaseFile without properties - product
401+ */
402+ public function testGetUrlWithOutProduct ()
403+ {
404+ $ this ->assertNull ($ this ->helper ->getUrl ());
405+ }
406+
399407 /**
400408 * @param array $data
401409 * @dataProvider getHeightDataProvider
You can’t perform that action at this time.
0 commit comments