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)
384
384
{
385
385
// assume that 3 params were given instead of array
386
386
if (!is_array ($ colorRGB )) {
387
+ //phpcs:disable
387
388
$ colorRGB = func_get_args ();
389
+ //phpcs:enabled
388
390
}
389
391
$ this ->_getModel ()->setBackgroundColor ($ colorRGB );
390
392
return $ this ;
@@ -498,7 +500,11 @@ protected function initBaseFile()
498
500
if ($ this ->getImageFile ()) {
499
501
$ model ->setBaseFile ($ this ->getImageFile ());
500
502
} else {
501
- $ model ->setBaseFile ($ this ->getProduct ()->getData ($ model ->getDestinationSubdir ()));
503
+ $ model ->setBaseFile (
504
+ $ this ->getProduct ()
505
+ ? $ this ->getProduct ()->getData ($ model ->getDestinationSubdir ())
506
+ : ''
507
+ );
502
508
}
503
509
}
504
510
return $ this ;
Original file line number Diff line number Diff line change @@ -396,6 +396,14 @@ public function testGetWidth()
396
396
$ this ->assertEquals ($ data ['width ' ], $ this ->helper ->getWidth ());
397
397
}
398
398
399
+ /**
400
+ * Check initBaseFile without properties - product
401
+ */
402
+ public function testGetUrlWithOutProduct ()
403
+ {
404
+ $ this ->assertNull ($ this ->helper ->getUrl ());
405
+ }
406
+
399
407
/**
400
408
* @param array $data
401
409
* @dataProvider getHeightDataProvider
You can’t perform that action at this time.
0 commit comments