Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
AloqaIM-Android
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
AloqaIM-Android
Commits
00c1d279
Commit
00c1d279
authored
Sep 22, 2017
by
Leonardo Aramaki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add null checks
parent
3aeddf34
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
2 deletions
+10
-2
RealmRoomRepository.java
...t/persistence/realm/repositories/RealmRoomRepository.java
+3
-0
RealmUserRepository.java
...t/persistence/realm/repositories/RealmUserRepository.java
+7
-2
No files found.
persistence-realm/src/main/java/chat/rocket/persistence/realm/repositories/RealmRoomRepository.java
View file @
00c1d279
...
...
@@ -84,6 +84,9 @@ public class RealmRoomRepository extends RealmRepository implements RoomReposito
return
Flowable
.
defer
(()
->
Flowable
.
using
(
()
->
new
Pair
<>(
RealmStore
.
getRealm
(
hostname
),
Looper
.
myLooper
()),
pair
->
{
if
(
pair
.
first
==
null
)
{
return
Flowable
.
empty
();
}
LoadMessageProcedure
messageProcedure
=
pair
.
first
.
where
(
LoadMessageProcedure
.
class
)
.
equalTo
(
LoadMessageProcedure
.
ID
,
roomId
)
...
...
persistence-realm/src/main/java/chat/rocket/persistence/realm/repositories/RealmUserRepository.java
View file @
00c1d279
...
...
@@ -60,11 +60,16 @@ public class RealmUserRepository extends RealmRepository implements UserReposito
private
Flowable
<
RealmResults
<
RealmUser
>>
realmGetCurrent
()
{
return
Flowable
.
using
(
()
->
new
Pair
<>(
RealmStore
.
getRealm
(
hostname
),
Looper
.
myLooper
()),
pair
->
RxJavaInterop
.
toV2Flowable
(
pair
->
{
if
(
pair
.
first
==
null
)
{
return
Flowable
.
empty
();
}
return
RxJavaInterop
.
toV2Flowable
(
pair
.
first
.
where
(
RealmUser
.
class
)
.
isNotEmpty
(
RealmUser
.
EMAILS
)
.
findAll
()
.<
RealmResults
<
RealmUser
>>
asObservable
()),
.<
RealmResults
<
RealmUser
>>
asObservable
());
},
pair
->
close
(
pair
.
first
,
pair
.
second
));
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a 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