Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit dec2b0fe authored by Jonathan Klee's avatar Jonathan Klee
Browse files

Fix possible NPE

Indeed, if authData is empty (which is the default value),
fromJson() returns null.
parent 569dfdb0
Loading
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -90,7 +90,12 @@ class AppLoungeDataStore @Inject constructor(
    }

    fun getAuthData(): AuthData {
        return gson.fromJson(authData.getSync(), AuthData::class.java)
        val authData = authData.getSync()
        return if (authData.isEmpty()) {
            AuthData("", "")
        } else {
            gson.fromJson(authData, AuthData::class.java)
        }
    }

    /**