Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exception if comments is null #38

Closed
OneHatRepo opened this issue Jun 20, 2020 · 1 comment
Closed

Exception if comments is null #38

OneHatRepo opened this issue Jun 20, 2020 · 1 comment
Assignees
Milestone

Comments

@OneHatRepo
Copy link

I'm getting the following exception thrown when calling $resourceRecord->getComments() and the value for $resourceRecord->comments is null:

TypeError: Return value of Exonet\Powerdns\Resources\ResourceRecord::getComments() must be of the type array, null returned

Perhaps $comments should be initialized to [] in ResourceRecord.php, line 29?

Or if that's not a good idea, then perhaps we could have a hasComments() method, so we can know when to call getComments()?

As it is right now, not even a try/catch block will suppress the exception.

@trizz trizz self-assigned this Jun 22, 2020
@trizz trizz added the bug label Jun 22, 2020
@trizz
Copy link
Member

trizz commented Jun 22, 2020

Hi @OneHatRepo,

Valid point. I'll address this together with #35.

@trizz trizz added this to the v2.4.0 milestone Jun 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants