Skip to content

Conversation

@nikiforosper
Copy link
Contributor

The previous code directly accessed operations.last, which could lead to a NoSuchElementException if the operations list was empty.

This commit changes the access to operations.lastOrNull?.data, which safely returns null if the list is empty, preventing potential runtime errors.

Refactor: Safely access 'last' element in operations

The previous code directly accessed `operations.last`, which could lead to a `NoSuchElementException` if the `operations` list was empty.

This commit changes the access to `operations.lastOrNull?.data`, which safely returns `null` if the list is empty, preventing potential runtime errors.
```
@CatHood0 CatHood0 merged commit c28738b into CatHood0:master Jul 19, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants