File tree 1 file changed +13
-11
lines changed
1 file changed +13
-11
lines changed Original file line number Diff line number Diff line change @@ -145,17 +145,19 @@ protected function createDiff()
145
145
$ this ->screenshotOutputPath . DIRECTORY_SEPARATOR . $ this ->getComparisonFilename ()
146
146
);
147
147
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
+ }
159
161
}
160
162
}
161
163
You can’t perform that action at this time.
0 commit comments