Skip to content

Commit 0e9404a

Browse files
committed
kotlin no-null crash fix
1 parent 944104f commit 0e9404a

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

library/src/main/java/com/gyso/treeview/layout/TreeLayoutManager.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,9 @@ public void setViewport(int winHeight, int winWidth) {
138138
* path->path from parent, same as paint
139139
*/
140140
public void performDrawLine(DrawInfo drawInfo){
141-
baseline.draw(drawInfo);
141+
if(baseline!=null){
142+
baseline.draw(drawInfo);
143+
}
142144
}
143145

144146
/**

library/src/main/java/com/gyso/treeview/listener/TreeViewControlListener.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
import android.view.View;
44

5+
import androidx.annotation.Nullable;
6+
57
import com.gyso.treeview.model.NodeModel;
68

79
/**
@@ -17,5 +19,5 @@ public interface TreeViewControlListener {
1719
int FREE_SCALE = 0;
1820
int MAX_SCALE = 1;
1921
void onScaling(int state, int percent);
20-
void onDragMoveNodesHit(NodeModel<?> draggingNode, NodeModel<?> hittingNode, View draggingView, View hittingView);
22+
void onDragMoveNodesHit(@Nullable NodeModel<?> draggingNode, @Nullable NodeModel<?> hittingNode, @Nullable View draggingView, @Nullable View hittingView);
2123
}

0 commit comments

Comments
 (0)