Commit 7fa7df5
authored
Avoid fatal error when Rest request fails in Package Browser (#16738)
### What does it do?
Better error handling in the `Workspace/Packages/Rest/GetList`
processor.
### Why is it needed?
While searching for extras in the "Package Browser", the code throws a
fatal error when there is a problem with the connection.
```
Uncaught TypeError: count(): Argument #1 ($value) must be of type Countable|array, string given
```
---
The `find()` function of the class `modTransportProvider` returns a
string if there is a error:
https://github.com/modxcms/revolution/blob/11d96669133bab7f1095c96be63368f841d8dbd7/core/src/Revolution/Transport/modTransportProvider.php#L3331 parent 11d9666 commit 7fa7df5
File tree
1 file changed
+3
-1
lines changed- core/src/Revolution/Processors/Workspace/Packages/Rest
1 file changed
+3
-1
lines changedLines changed: 3 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
76 | | - | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
77 | 79 | | |
78 | 80 | | |
79 | 81 | | |
| |||
0 commit comments