From 888f87246c28c9319ad456628bb08806118d86ca Mon Sep 17 00:00:00 2001 From: Ryo Nakano Date: Tue, 23 Apr 2024 23:33:31 +0900 Subject: [PATCH] Do not use assert_not_reached() Since it terminates the app immediately --- lib/Case.vala | 3 ++- lib/Converter.vala | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/Case.vala b/lib/Case.vala index 82afdd6..ffe54cc 100644 --- a/lib/Case.vala +++ b/lib/Case.vala @@ -59,7 +59,8 @@ namespace ChCase { case Case.SENTENCE: return "sentence"; default: - assert_not_reached (); + warning ("Invalid Case: %d", this); + return ""; } } } diff --git a/lib/Converter.vala b/lib/Converter.vala index 86250e3..d9551c0 100644 --- a/lib/Converter.vala +++ b/lib/Converter.vala @@ -266,7 +266,8 @@ namespace ChCase { regex_pattern = new PatternType.Sentence (result_case); break; default: - assert_not_reached (); + warning ("Invalid Case: %d", source_case); + return result; } try {