mirror of
https://github.com/solero/houdini.git
synced 2024-11-24 22:47:22 +00:00
Check track has been found before trying to access its attributes
This commit is contained in:
parent
ae30ca33c0
commit
91f287087f
@ -197,9 +197,10 @@ async def handle_get_shared_music_tracks(p):
|
|||||||
@handlers.player_in_room(SoundStudio.StudioRoomId, SoundStudio.DeckRoomId)
|
@handlers.player_in_room(SoundStudio.StudioRoomId, SoundStudio.DeckRoomId)
|
||||||
async def handle_load_music_track(p, owner_id: int, track_id: int):
|
async def handle_load_music_track(p, owner_id: int, track_id: int):
|
||||||
track = await get_track(owner_id, track_id)
|
track = await get_track(owner_id, track_id)
|
||||||
encoded_track_pattern = encode_music_track(track.pattern)
|
if track is not None:
|
||||||
await p.send_xt('loadmusictrack', track.id, track.name, int(track.sharing), track.pattern,
|
encoded_track_pattern = encode_music_track(track.pattern)
|
||||||
encoded_track_pattern, track.likes)
|
await p.send_xt('loadmusictrack', track.id, track.name, int(track.sharing), track.pattern,
|
||||||
|
encoded_track_pattern, track.likes)
|
||||||
|
|
||||||
|
|
||||||
@handlers.handler(XTPacket('musictrack', 'savemymusictrack'), client=ClientType.Vanilla)
|
@handlers.handler(XTPacket('musictrack', 'savemymusictrack'), client=ClientType.Vanilla)
|
||||||
|
Loading…
Reference in New Issue
Block a user