Skip to content

Commit 41e11de

Browse files
committed
Make patch revert silent when no reverts possible
1 parent abb89cd commit 41e11de

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Listener/CodePatchListener.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public function patch(ExerciseRunnerEvent $event): void
6363
public function revert(\PhpSchool\PhpWorkshop\Event\EventInterface $event): void
6464
{
6565
if (null === $this->originalCode || empty($this->originalCode)) {
66-
throw new RuntimeException('Can only revert previously patched code');
66+
return;
6767
}
6868

6969
foreach ($this->originalCode as $fileName => $contents) {

0 commit comments

Comments
 (0)