diff options
Diffstat (limited to 'lib/Matrix/Client/Room.pm6')
-rw-r--r-- | lib/Matrix/Client/Room.pm6 | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/Matrix/Client/Room.pm6 b/lib/Matrix/Client/Room.pm6 index d8a9848..fa4501a 100644 --- a/lib/Matrix/Client/Room.pm6 +++ b/lib/Matrix/Client/Room.pm6 @@ -13,6 +13,14 @@ submethod TWEAK { } method !get-name() { + CATCH { + when X::Matrix::Response { + .code ~~ /M_NOT_FOUND/ + ?? ($!name = '') + !! fail + } + default { fail } + } my $data = $.state('m.room.name'); $!name = $data<name>; } |