Skip to content

Commit a1e6508

Browse files
authored
Initialize typed property "labels" so it can be accessed even if empty (#69)
* Update IssueField.php Fix "Typed property JiraCloud\Issue\IssueField::$labels must not be accessed before initialization" when trying to access labels of a retrieved issue. * Update IssueField.php Remove whitespace in a blank line
1 parent 0b12436 commit a1e6508

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/Issue/IssueField.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,8 @@ class IssueField implements \JsonSerializable
102102

103103
public function __construct($updateIssue = false)
104104
{
105+
$this->labels = [];
106+
105107
if ($updateIssue !== true) {
106108
$this->project = new \JiraCloud\Project\Project();
107109

0 commit comments

Comments
 (0)