这是indexloc提供的服务,不要输入任何密码
Skip to content

termux-dialog (sheet and possibly more dialog options) don't handle null choices #486

@StevenAlexander44

Description

@StevenAlexander44

Problem description

termux-dialog sheet crashes if no option is chosen

Steps to reproduce

termux-dialog sheet -v 'Item One','Item Two' will crash if the user clicks out of the dialog prompt (choosing neither one nor two)

Expected behavior

I believe that it used to properly output -1 in the json index like this:

{
  "code": -1,
  "text": "",
  "index": -1
}

Additional information

  • termux-api application version: 0.50.1 (51)
  • termux-api package version (installed through apt): 0.57
  • Android OS version: 11
  • Device model: moto g play (XT2093DL)
  • target-sdk: 28

Copied from crash_log.md

Crash Message:

Attempt to invoke virtual method 'android.os.IBinder android.view.View.getWindowToken()' on a null object reference

The stacktrace is long so I won't post unless its needed

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions