From f992b8ab71424b6d1ed9567055e6c37b7cb2bf7e Mon Sep 17 00:00:00 2001 From: Maho Pacheco Date: Thu, 22 Feb 2024 22:45:00 -0800 Subject: [PATCH] Fixing null problems --- RaccoonBitsCore/Db.cs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/RaccoonBitsCore/Db.cs b/RaccoonBitsCore/Db.cs index fe40a55..bb2f7e4 100644 --- a/RaccoonBitsCore/Db.cs +++ b/RaccoonBitsCore/Db.cs @@ -187,11 +187,11 @@ public IEnumerable GetPosts( { string uri = reader["uri"]?.ToString() ?? string.Empty; string jsonObject = reader["jsonObject"]?.ToString() ?? string.Empty; - double score = (double)reader["score"]; - double wordsScore = Convert.ToDouble(reader["wordsScore"] ?? 0); - double buzzScore = (double)reader["buzzScore"]; - double fameScore = (double)reader["fameScore"]; - double hostScore = (double)reader["hostScore"]; + double score = Convert.ToDouble(reader["score"]?.ToString() ?? "0"); + double wordsScore = Convert.ToDouble(reader["wordsScore"]?.ToString() ?? "0"); + double buzzScore = Convert.ToDouble(reader["buzzScore"]?.ToString() ?? "0"); + double fameScore = Convert.ToDouble(reader["fameScore"]?.ToString() ?? "0"); + double hostScore = Convert.ToDouble(reader["hostScore"]?.ToString() ?? "0"); var post = new Post(uri, jsonObject) { @@ -201,7 +201,7 @@ public IEnumerable GetPosts( FameScore = fameScore, HostScore = hostScore }; - + if (processor != null) { post = processor.Process(post);