Skip to content

Application crashes on right-click in empty Project Explorer space #509

@nayifus

Description

@nayifus

Steps to Reproduce

  1. Start the application
  2. Open the Project Explorer panel
  3. Right-click on an empty region (no file/folder selected)

Expected Behavior

The application should continue running normally. It should either do nothing or display a basic context menu.


Actual Behavior

Right-clicking without any selected item causes the application to crash.


Environment

  • eSim version: Latest (master)
  • OS: Windows (64-bit)

Cause

The current implementation of the context menu depends on selectedIndexes() and assumes that a selection is always present.
When the selection is empty:

  • Attempting to access the first index results in an error
  • Some dependent variables may not get assigned properly

Suggested Fix

Instead of relying on selection, determine the clicked item using indexAt(position) and verify it with index.isValid() before using it.
This ensures safe handling of clicks on empty areas.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions