Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Keunes
Funkwhale Android
Commits
1209a0a5
Commit
1209a0a5
authored
Aug 26, 2021
by
Ryan Harg
Browse files
#83: Fix invalid null handling for add to playlist
parent
1f4ccff0
Changes
2
Hide whitespace changes
Inline
Side-by-side
app/src/main/java/audio/funkwhale/ffa/repositories/PlaylistsRepository.kt
View file @
1209a0a5
...
...
@@ -82,7 +82,7 @@ class ManagementPlaylistsRepository(override val context: Context?) :
}
fun
add
(
id
:
Int
,
tracks
:
List
<
Track
>)
{
context
?.
let
{
if
(
context
!=
null
)
{
val
body
=
PlaylistAdd
(
tracks
.
map
{
it
.
id
},
false
)
val
request
=
Fuel
.
post
(
mustNormalizeUrl
(
"/api/v1/playlists/$id/add/"
)).
apply
{
...
...
@@ -98,8 +98,9 @@ class ManagementPlaylistsRepository(override val context: Context?) :
.
body
(
Gson
().
toJson
(
body
))
.
awaitByteArrayResponseResult
()
}
}
else
{
throw
IllegalStateException
(
"Illegal state: context is null"
)
}
throw
IllegalStateException
(
"Illegal state: context is null"
)
}
suspend
fun
remove
(
id
:
Int
,
track
:
Track
,
index
:
Int
)
{
...
...
changes/changelog.d/83.bugfix
0 → 100644
View file @
1209a0a5
Fix application crash when adding song to playlist (#83)
\ No newline at end of file
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment