Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Matter fix exception when fabrics is not initialized #20667

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,11 @@ class Matter_Session_Store
# Count the number of commissionned fabrics, i.e. persisted
def count_active_fabrics()
self.remove_expired() # clean before
return self.fabrics.count_persistables()
if self.fabrics != nil
return self.fabrics.count_persistables()
else
return 0
end
end

#############################################################
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -508,20 +508,28 @@ be_local_closure(Matter_Session_Store_count_active_fabrics, /* name */
0, /* has sup protos */
NULL, /* no sub protos */
1, /* has constants */
( &(const bvalue[ 3]) { /* constants */
( &(const bvalue[ 4]) { /* constants */
/* K0 */ be_nested_str_weak(remove_expired),
/* K1 */ be_nested_str_weak(fabrics),
/* K2 */ be_nested_str_weak(count_persistables),
/* K3 */ be_const_int(0),
}),
be_str_weak(count_active_fabrics),
&be_const_str_solidified,
( &(const binstruction[ 6]) { /* code */
( &(const binstruction[13]) { /* code */
0x8C040100, // 0000 GETMET R1 R0 K0
0x7C040200, // 0001 CALL R1 1
0x88040101, // 0002 GETMBR R1 R0 K1
0x8C040302, // 0003 GETMET R1 R1 K2
0x7C040200, // 0004 CALL R1 1
0x80040200, // 0005 RET 1 R1
0x4C080000, // 0003 LDNIL R2
0x20040202, // 0004 NE R1 R1 R2
0x78060004, // 0005 JMPF R1 #000B
0x88040101, // 0006 GETMBR R1 R0 K1
0x8C040302, // 0007 GETMET R1 R1 K2
0x7C040200, // 0008 CALL R1 1
0x80040200, // 0009 RET 1 R1
0x70020000, // 000A JMP #000C
0x80060600, // 000B RET 1 K3
0x80000000, // 000C RET 0
})
)
);
Expand Down