Skip to content

Commit 5f7517d

Browse files
committed
Check if warrants array is empty
1 parent 322c40e commit 5f7517d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/ProtectedComponent.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const ProtectedComponent: React.FunctionComponent<ProtectedComponentProps> = ({
1111
const { sessionToken, hasWarrant } = useWarrant();
1212

1313
useEffect(() => {
14-
if (!warrants) {
14+
if (!warrants || warrants.length === 0) {
1515
throw new Error("Invalid or no warrants provided to ProtectedComponent");
1616
}
1717

0 commit comments

Comments
 (0)