Skip to content

Commit

Permalink
Merge pull request #25906 from storybookjs/dannyhw/fix-compose-story-…
Browse files Browse the repository at this point in the history
…tests-v2

React Native: Fix errors on compose story
  • Loading branch information
yannbf authored Feb 5, 2024
2 parents 617e48f + 2a6a501 commit f4dd3f5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion code/lib/preview-api/src/modules/preview-web/UrlStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ const getFirstString = (v: ValueOf<qs.ParsedQs>): string | void => {
};

export const getSelectionSpecifierFromPath: () => SelectionSpecifier | null = () => {
const query = qs.parse(document.location.search, { ignoreQueryPrefix: true });
const query = qs.parse(document?.location?.search, { ignoreQueryPrefix: true });
const args = typeof query.args === 'string' ? parseArgsParam(query.args) : undefined;
const globals = typeof query.globals === 'string' ? parseArgsParam(query.globals) : undefined;

Expand Down
2 changes: 1 addition & 1 deletion code/lib/preview-api/src/modules/preview-web/WebView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export class WebView implements View<HTMLElement> {
constructor() {
// Special code for testing situations
// eslint-disable-next-line @typescript-eslint/naming-convention
const { __SPECIAL_TEST_PARAMETER__ } = qs.parse(document.location.search, {
const { __SPECIAL_TEST_PARAMETER__ } = qs.parse(document?.location?.search, {
ignoreQueryPrefix: true,
});
switch (__SPECIAL_TEST_PARAMETER__) {
Expand Down

0 comments on commit f4dd3f5

Please sign in to comment.