Skip to content

Commit f4c0f39

Browse files
Merge pull request #6 from baolanlequang/development
fixed check children
2 parents 18d1ad9 + 720058d commit f4c0f39

File tree

1 file changed

+3
-3
lines changed
  • JcampConverter/JcampConverter/src/main/java/com/baolan2005/jcampconverter

1 file changed

+3
-3
lines changed

JcampConverter/JcampConverter/src/main/java/com/baolan2005/jcampconverter/Jcamp.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class Jcamp {
1313
private val arrTypeDataXPlusY = arrayOf("(X++(Y..Y)", "(X++(R..R)", "(X++(I..I)")
1414
private val arrTypeDataXY = arrayOf("(XY..XY)")
1515

16-
lateinit var children: ArrayList<Jcamp>
16+
var children: ArrayList<Jcamp>? = null;
1717

1818
public class Spectra {
1919
public var xValues: ArrayList<Double>
@@ -33,7 +33,7 @@ class Jcamp {
3333

3434
public fun hasChild(): Boolean {
3535
if (children != null) {
36-
return children.size > 0
36+
return children!!.size > 0
3737
}
3838
return false
3939
}
@@ -59,7 +59,7 @@ class Jcamp {
5959
if (this.children == null) {
6060
this.children = ArrayList()
6161
}
62-
this.children.add(childJcamp)
62+
this.children?.add(childJcamp)
6363
}
6464
else if (value is String) {
6565
val childString = value

0 commit comments

Comments
 (0)