Skip to content

Commit

Permalink
fix: Out of index crash fix
Browse files Browse the repository at this point in the history
  • Loading branch information
SyntaxGalaxy committed Nov 17, 2023
1 parent 22a1e12 commit 291162f
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -390,10 +390,10 @@ public boolean onDrag(View v, DragEvent dragEvent) {
} else {
blockView = (BlockDefaultView) dragView;
if (dragView.getParent() != null) {
if (((ViewGroup) dragView.getParent()).getId() == R.id.blockListEditorArea) {
if (((ViewGroup) dragView.getParent()).getId() != R.id.relativeBlockListEditorArea) {
int index2 = ((ViewGroup) dragView.getParent()).indexOfChild(dragView);
if (index2 < index) {
if (((ViewGroup) v).getId() == R.id.blockListEditorArea) {
if (((ViewGroup) v).getId() != R.id.relativeBlockListEditorArea) {
index = index - 1;
}
}
Expand Down Expand Up @@ -445,10 +445,10 @@ public boolean onDrag(View v, DragEvent dragEvent) {
} else {
blockView = (ComplexBlockView) dragView;
if (dragView.getParent() != null) {
if (((ViewGroup) dragView.getParent()).getId() == R.id.blockListEditorArea) {
if (((ViewGroup) dragView.getParent()).getId() != R.id.relativeBlockListEditorArea) {
int index2 = ((ViewGroup) dragView.getParent()).indexOfChild(dragView);
if (index2 < index) {
if (((ViewGroup) v).getId() == R.id.blockListEditorArea) {
if (((ViewGroup) v).getId() != R.id.relativeBlockListEditorArea) {
index = index - 1;
}
}
Expand Down

0 comments on commit 291162f

Please sign in to comment.