Skip to content

Commit

Permalink
fix: empty route handling
Browse files Browse the repository at this point in the history
  • Loading branch information
artmizu committed Aug 25, 2023
1 parent e221841 commit 44fd111
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/runtime/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import { defineNuxtPlugin, useRouter, useRuntimeConfig } from '#app'
export default defineNuxtPlugin((ctx) => {
const params = useRuntimeConfig().public.prometheus
const router = useRouter()
const path = router.currentRoute.value.matched[0]?.path || ''
const name = router.currentRoute.value.name
const path = router.currentRoute.value?.matched?.[0]?.path || 'empty'
const name = router.currentRoute.value?.name || 'empty'
const interceptor = new BatchInterceptor({
name: 'nuxt-prometheus',
interceptors: [
Expand Down

0 comments on commit 44fd111

Please sign in to comment.