Skip to content

Commit 078efff

Browse files
authored
When reading model from file, model->sv_indices is null
1 parent f2c87a5 commit 078efff

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/LibSvmDotNet/Model.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@ internal unsafe Model(IntPtr ptr)
4040
this.SupportVectorCoefficients[index] = Copy(model->sv_coef[index], this.L);
4141
}
4242

43-
this.SupportVectorIndices = Copy(model->sv_indices, this.L);
43+
if (model->sv_indices != null)
44+
this.SupportVectorIndices = Copy(model->sv_indices, this.L);
4445

4546
var length = (this.Classes - 1) * this.Classes / 2;
4647
this.Rho = Copy(model->rho, length);

0 commit comments

Comments
 (0)