Skip to content

Commit c2bc621

Browse files
committed
fix(useFetch): check if it's object for isFetchOptions
1 parent cc7f48b commit c2bc621

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/core/useFetch/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ export interface CreateFetchOptions {
211211
* to include the new options
212212
*/
213213
function isFetchOptions(obj: object): obj is UseFetchOptions {
214-
return containsProp(obj, 'immediate', 'refetch', 'initialData', 'timeout', 'beforeFetch', 'afterFetch', 'onFetchError', 'fetch')
214+
return obj && containsProp(obj, 'immediate', 'refetch', 'initialData', 'timeout', 'beforeFetch', 'afterFetch', 'onFetchError', 'fetch')
215215
}
216216

217217
// A URL is considered absolute if it begins with "<scheme>://" or "//" (protocol-relative URL).

0 commit comments

Comments
 (0)