Skip to content

Fix router error - #6079

Merged
abnegate merged 2 commits into
1.4.xfrom
fix-500-options-requests
Aug 30, 2023
Merged

abnegate merged 2 commits into
1.4.xfrom
fix-500-options-requests

Conversation

@stnguyen90

Copy link
Copy Markdown
Contributor

What does this PR do?

It's possible for the route to be null (no match) which leads to an error like:

appwrite  | [Error] Timestamp: 2023-08-30T21:39:58+00:00
appwrite  | [Error] Type: Error
appwrite  | [Error] Message: Call to a member function label() on null
appwrite  | [Error] File: /usr/src/code/app/controllers/general.php
appwrite  | [Error] Line: 50

This adds a null check to prevent the error.

Test Plan

Manually made an API call to a custom endpoint and confirmed no more "Call to a member function label() on null" error.

Related PRs and Issues

None

Checklist

  • Have you read the Contributing Guidelines on issues?
  • If the PR includes a change to an API's metadata (desc, label, params, etc.), does it also include updated API specs and example docs?

@stnguyen90
stnguyen90 marked this pull request as ready for review August 30, 2023 22:24

@christyjacob4 christyjacob4 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch 👀

It's possible for the route to be null (no match) which leads to an
error like:

```
appwrite  | [Error] Timestamp: 2023-08-30T21:39:58+00:00
appwrite  | [Error] Type: Error
appwrite  | [Error] Message: Call to a member function label() on null
appwrite  | [Error] File: /usr/src/code/app/controllers/general.php
appwrite  | [Error] Line: 50
```

This adds a null check to prevent the error.
@stnguyen90
stnguyen90 force-pushed the fix-500-options-requests branch from eb4f8f2 to ac0b697 Compare August 30, 2023 23:08
@abnegate
abnegate merged commit 02c1604 into 1.4.x Aug 30, 2023
@stnguyen90
stnguyen90 deleted the fix-500-options-requests branch September 10, 2023 16:33
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

Successfully merging this pull request may close these issues.

3 participants