From 83c687a032e49f0a21a5bf2e3895752e72006b36 Mon Sep 17 00:00:00 2001 From: morebytes <22108504+morebytes@users.noreply.github.com> Date: Thu, 28 Nov 2024 01:52:47 -0800 Subject: [PATCH] Fixes the free food PROD bug. Apparently, was being caused by inconsistent message data being returned from PROD endpoints. Certain values in Message models could be null when they were not officially supposed to be. --- lib/core/models/notifications.dart | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/core/models/notifications.dart b/lib/core/models/notifications.dart index e9522a0d3..9bc1f18f4 100644 --- a/lib/core/models/notifications.dart +++ b/lib/core/models/notifications.dart @@ -72,6 +72,7 @@ class Audience { } class Message { + String message; String title; Data data; @@ -83,8 +84,9 @@ class Message { }); Message.fromJson(Map json) - : message = json["message"], - title = json["title"], + // Defaulting to empty strings until we figure out what should or should not be null on the backend + : message = json["message"] ?? "", + title = json["title"] ?? "", data = Data.fromJson(json["data"]); Map toJson() => {