Skip to content

fix: /apps deep link crashes on malformed URL (missing path segment check) #4762

Closed

Description

@beastoin

Problem

app/lib/core/app_shell.dart:64 accesses uri.pathSegments[1] without checking that the array has more than 1 element:

if (uri.pathSegments.first == 'apps') {
  if (mounted) {
    var app = await context.read<AppProvider>().getAppFromId(uri.pathSegments[1]); // 💥 RangeError

Opening h.omi.me/apps (no app ID) or omi://h.omi.me/apps throws RangeError (index) and crashes.

The /tasks handler added in PR #4737 correctly guards with uri.pathSegments.length > 1, but the existing /apps handler does not.

Reproduction

adb shell am start -a android.intent.action.VIEW -d "https://h.omi.me/apps" com.friend.ios

App crashes with RangeError.

Fix

Add length check before accessing pathSegments[1], matching the /tasks pattern:

} else if (uri.pathSegments.first == 'apps' && uri.pathSegments.length > 1) {

Context

Found during deep link audit of PR #4737 (task sharing). Credit: @kenji's audit.

Sub-issue of #4724.

Activity

  1. added
    ux-polish
    maintainer
    p1
    on Feb 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    maintainerp1ux-polish

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions