Skip to content

Commit bfdd9d0

Browse files
authored
Merge pull request #22 from RNVD/thk_RNVD
Null exception handling and add variable
2 parents 6d64b57 + f0acf9d commit bfdd9d0

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

lib/src/models/get-query.dart

+4
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ class GetDataType {
5959
}
6060

6161
class GetQuery {
62+
String? topic;
6263
bool? cred;
6364
bool? tags;
6465
String? what;
@@ -68,6 +69,7 @@ class GetQuery {
6869
GetDataType? del;
6970

7071
GetQuery({
72+
this.topic,
7173
this.desc,
7274
this.sub,
7375
this.data,
@@ -79,6 +81,7 @@ class GetQuery {
7981

8082
static GetQuery fromMessage(Map<String, dynamic> msg) {
8183
return GetQuery(
84+
topic: msg['topic'],
8285
cred: msg['cred'],
8386
what: msg['what'],
8487
data: msg['data'] != null ? GetDataType.fromMessage(msg['data']) : null,
@@ -91,6 +94,7 @@ class GetQuery {
9194

9295
Map<String, dynamic> toMap() {
9396
var map = {
97+
'topic':topic,
9498
'cred': cred,
9599
'what': what,
96100
'data': data != null ? data?.toMap() : null,

lib/src/topic.dart

+7-2
Original file line numberDiff line numberDiff line change
@@ -710,8 +710,13 @@ class Topic {
710710
/// Process data message
711711
void routeData(DataMessage data) {
712712
if (data.content != null) {
713-
if (touched!.isBefore(data.ts!)) {
714-
touched = data.ts;
713+
if (touched == null) {
714+
touched=data.ts;
715+
}
716+
else{
717+
if (touched!.isBefore(data.ts!)) {
718+
touched = data.ts;
719+
}
715720
}
716721
}
717722

0 commit comments

Comments
 (0)