Skip to content

Commit 6bb140e

Browse files
add error checking in extract tuples methods
1 parent 4be92b7 commit 6bb140e

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

src/Object_Methods/Matrix_Methods.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -452,6 +452,9 @@ julia> GrB_Matrix_extractTuples(MAT)
452452
"""
453453
function GrB_Matrix_extractTuples(A::GrB_Matrix{T}) where T <: valid_types
454454
nvals = GrB_Matrix_nvals(A)
455+
if typeof(nvals) == GrB_Info
456+
return nvals
457+
end
455458
U = typeof(nvals)
456459
row_indices = Vector{U}(undef, nvals)
457460
col_indices = Vector{U}(undef, nvals)

src/Object_Methods/Vector_Methods.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -410,6 +410,9 @@ julia> GrB_Vector_extractTuples(V)
410410
"""
411411
function GrB_Vector_extractTuples(v::GrB_Vector{T}) where T <: valid_types
412412
nvals = GrB_Vector_nvals(v)
413+
if typeof(nvals) == GrB_Info
414+
return nvals
415+
end
413416
I = Vector{typeof(nvals)}(undef, nvals)
414417
X = Vector{T}(undef, nvals)
415418
n = Ref(UInt64(nvals))

0 commit comments

Comments
 (0)