Skip to content

Commit

Permalink
ref(ts): Fix null errors in platformSection (#7372)
Browse files Browse the repository at this point in the history
  • Loading branch information
evanpurkhiser authored Jul 10, 2023
1 parent f39bbad commit 7aca7eb
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/components/platformSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ export function PlatformSection({
children,
}: Props) {
const [currentPlatform] = usePlatform(platform);

if (!currentPlatform) {
return null;
}

if (noGuides && !(currentPlatform as Platform).guides) {
return null;
}
Expand All @@ -40,7 +45,7 @@ export function PlatformSection({

let result: boolean | null = null;
// eslint-disable-next-line no-cond-assign
for (let platformKey, i = 0; (platformKey = platformsToSearch[i]); i++) {
for (let platformKey: string, i = 0; (platformKey = platformsToSearch[i]); i++) {
if (!platformKey) {
continue;
}
Expand Down

0 comments on commit 7aca7eb

Please sign in to comment.