This repository was archived by the owner on Apr 13, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +13
-11
lines changed Expand file tree Collapse file tree 1 file changed +13
-11
lines changed Original file line number Diff line number Diff line change @@ -145,17 +145,19 @@ protected function createDiff()
145145 $ this ->screenshotOutputPath . DIRECTORY_SEPARATOR . $ this ->getComparisonFilename ()
146146 );
147147
148- try {
149- Assert::assertLessThanOrEqual (
150- config ('visualdiff.maximum_error_percentage ' ),
151- $ result ->error_percentage ,
152- "The visual diff for " . $ this ->name . " has a higher pixel diff than the allowed maximum. " . PHP_EOL .
153- "See: " . $ this ->diffOutputPath . $ this ->getDiffFilename ()
154- );
155- } catch (ExpectationFailedException $ e ) {
156- echo exec (__DIR__ . '/../bin/imgcat ' . escapeshellarg ($ this ->diffOutputPath . DIRECTORY_SEPARATOR . $ this ->getDiffFilename ()));
157-
158- throw $ e ;
148+ if (! is_null ($ result )) {
149+ try {
150+ Assert::assertLessThanOrEqual (
151+ config ('visualdiff.maximum_error_percentage ' ),
152+ $ result ->error_percentage ,
153+ "The visual diff for " . $ this ->name . " has a higher pixel diff than the allowed maximum. " . PHP_EOL .
154+ "See: " . $ this ->diffOutputPath . $ this ->getDiffFilename ()
155+ );
156+ } catch (ExpectationFailedException $ e ) {
157+ echo exec (__DIR__ . '/../bin/imgcat ' . escapeshellarg ($ this ->diffOutputPath . DIRECTORY_SEPARATOR . $ this ->getDiffFilename ()));
158+
159+ throw $ e ;
160+ }
159161 }
160162 }
161163
You can’t perform that action at this time.
0 commit comments