Skip to content

Commit 185ece4

Browse files
fix: [M3-8894] - Linode Create crash when selected a Linode with a type that is null (#11247)
* don't fetch when `type` is an empty string * fix and changelog entry --------- Co-authored-by: Banks Nussman <[email protected]>
1 parent fe172fa commit 185ece4

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

packages/manager/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p
4040
- UI bugs on the Object Storage bucket and access key landing pages ([#11187](https://github.com/linode/manager/pull/11187))
4141
- Animation for VPC subnet drawers ([#11195](https://github.com/linode/manager/pull/11195))
4242
- DBaaS enable creation of two node clusters ([#11218](https://github.com/linode/manager/pull/11218))
43+
- Crash on the Linode Create flow when a Linode with a `type` of `null` is selected ([#11247](https://github.com/linode/manager/pull/11247))
4344

4445
### Tech Stories:
4546

packages/manager/src/features/Linodes/LinodeCreate/Region.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ export const Region = React.memo(() => {
7676

7777
const { data: type } = useTypeQuery(
7878
selectedLinode?.type ?? '',
79-
Boolean(selectedLinode)
79+
Boolean(selectedLinode?.type)
8080
);
8181

8282
const isLinodeCreateRestricted = useRestrictedGlobalGrantCheck({

packages/manager/src/queries/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export const useSpecificTypes = (types: string[], enabled = true) => {
2525

2626
return useQueries({
2727
queries: types.map<UseQueryOptions<LinodeType, APIError[]>>((type) => ({
28-
enabled,
28+
enabled: enabled && Boolean(type),
2929
...linodeQueries.types._ctx.type(type),
3030
...queryPresets.oneTimeFetch,
3131
initialData() {

0 commit comments

Comments
 (0)