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

bug: PostgrestErrorException property accessed before initialization error #5

Open
CptKirk opened this issue Sep 4, 2023 · 0 comments · May be fixed by #6
Open

bug: PostgrestErrorException property accessed before initialization error #5

CptKirk opened this issue Sep 4, 2023 · 0 comments · May be fixed by #6
Assignees
Labels
bug Something isn't working

Comments

@CptKirk
Copy link
Contributor

CptKirk commented Sep 4, 2023

Describe the bug
In PostgrestErrorException the properties are not initialized with null which can cause a crash if one acesses these properties without isset(). This is unexpected behaviour and should be fixed.

To Reproduce
Initialize PostgrestErrorException with an exception other than React\Http\Message\ResponseException and access any property.

<?php
$previous = new Exception();
$test = new PostgrestErrorException($previous);
$status = $test->getStatusCode(); # causes error

Expected behavior
The properties should be initialized with null, so no unexpected errors occure.

Further Code
n/a

Setup
n/a

Additional context
n/a

@CptKirk CptKirk added the bug Something isn't working label Sep 4, 2023
@CptKirk CptKirk self-assigned this Sep 4, 2023
@CptKirk CptKirk linked a pull request Sep 4, 2023 that will close this issue
@CptKirk CptKirk moved this to In Progress in Tickets: postgrest-php Sep 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: In Progress
Development

Successfully merging a pull request may close this issue.

1 participant