Skip to content

Commit c920be5

Browse files
committed
Fix query for old protocol
1 parent 8cbf774 commit c920be5

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/MinecraftQueryResolver.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,13 @@ public function getResult(bool $tryOldQueryProtocolPre17 = false): MinecraftQuer
6060
public function getRawData(bool $tryOldQueryProtocolPre17 = false): array
6161
{
6262
if ($this->rawData === null) {
63-
$this->retrieveData();
63+
try {
64+
$this->retrieveData();
65+
} catch (MinecraftQueryException $e) {
66+
if (!$tryOldQueryProtocolPre17) {
67+
throw $e;
68+
}
69+
}
6470
}
6571

6672
if ($tryOldQueryProtocolPre17 && $this->rawData === null) {

0 commit comments

Comments
 (0)