Skip to content

Commit aadafdb

Browse files
committed
🥅 Throw errors
1 parent e1a1368 commit aadafdb

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/components/ModalContainer.vue

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,13 @@
1616
import {ref, markRaw} from 'vue';
1717
import type {Modal, PromiseResolve, PromiseReject} from '../types/modal';
1818
import type {AddModalProxyParams, CloseModalProxyParams} from '../types/modal-proxy';
19+
import {err} from '../utils';
1920
2021
const id = ref<number>(0);
2122
const modals = ref<Modal[]>([]);
2223
2324
const addModal = ({key, component, props = {}}: AddModalProxyParams) => {
25+
if (!component) err('Invalid component was passed.');
2426
return new Promise((resolve, reject) => {
2527
modals.value.push({
2628
key,

0 commit comments

Comments
 (0)