aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/kotlin/com/pitchedapps/frost/facebook/requests/FbRequest.kt
diff options
context:
space:
mode:
Diffstat (limited to 'app/src/main/kotlin/com/pitchedapps/frost/facebook/requests/FbRequest.kt')
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/facebook/requests/FbRequest.kt3
1 files changed, 2 insertions, 1 deletions
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/facebook/requests/FbRequest.kt b/app/src/main/kotlin/com/pitchedapps/frost/facebook/requests/FbRequest.kt
index e3e77c5c..cefece36 100644
--- a/app/src/main/kotlin/com/pitchedapps/frost/facebook/requests/FbRequest.kt
+++ b/app/src/main/kotlin/com/pitchedapps/frost/facebook/requests/FbRequest.kt
@@ -19,7 +19,8 @@ private val authMap: MutableMap<String, RequestAuth> = mutableMapOf()
* [action] will only be called if a valid auth is found.
* Otherwise, [fail] will be called
*/
-fun String.fbRequest(fail: () -> Unit = {}, action: RequestAuth.() -> Unit) {
+fun String?.fbRequest(fail: () -> Unit = {}, action: RequestAuth.() -> Unit) {
+ if (this == null) return fail()
val savedAuth = authMap[this]
if (savedAuth != null) {
savedAuth.action()