Skip to content

Commit 30369e5

Browse files
committed
Return null if nothing found in case if find()
1 parent 3fcf425 commit 30369e5

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/Picqer/Carriers/SendCloud/Query/FindOne.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,11 @@ public function find($id)
66
{
77
$result = $this->connection()->get($this->url . '/' . urlencode($id));
88

9+
if (!array_key_exists($this->namespaces['singular'], $result)) {
10+
return null;
11+
}
12+
913
return new self($this->connection(), $result[$this->namespaces['singular']]);
1014
}
1115

12-
}
16+
}

0 commit comments

Comments
 (0)