B2026-028_Selecting_to_Go_To_on_an_RO_causes_PROMS_to_crash #730

Merged
jjenko merged 3 commits from B2026-028_Selecting_to_Go_To_on_an_RO_causes_PROMS_to_crash into Development 2026-03-09 14:41:04 -04:00
Showing only changes of commit 4656ec30af - Show all commits
+4 -3
View File
@@ -372,14 +372,15 @@ namespace Volian.Controls.Library
{ {
// B2022-088: [JPR] Find Doc Ro button not working in Word Sections // B2022-088: [JPR] Find Doc Ro button not working in Word Sections
// B2022-098: [JPR] ROs not being resolved in Word Sections // B2022-098: [JPR] ROs not being resolved in Word Sections
if (e.Node.Tag is ROFSTLookup.rochild){ if (e.Node.Tag is ROFSTLookup.rochild)
{
ROFSTLookup.rochild chld = (ROFSTLookup.rochild)e.Node.Tag; ROFSTLookup.rochild chld = (ROFSTLookup.rochild)e.Node.Tag;
chld.value = Regex.Replace(chld.value, @"\\u([0-9]{1,4})\?", m => Convert.ToChar(int.Parse(m.Groups[1].Value)).ToString());
selectedChld = chld; selectedChld = chld;
if (chld.value != null) if (chld.value != null)
{ {
RoUsageInfo SavROLink = null; chld.value = Regex.Replace(chld.value, @"\\u([0-9]{1,4})\?", m => Convert.ToChar(int.Parse(m.Groups[1].Value)).ToString());
mschill marked this conversation as resolved Outdated
Outdated
Review

Could there be an exception here with the int.Parse?

Should this be something like:

chld.value = Regex.Replace(chld.value, @"\u([0-9]{1,4})?", m => int.TryParse(m?.Groups[1]?.Value, out int result) ? Convert.ToChar(result).ToString() : "");

Could there be an exception here with the int.Parse? Should this be something like: chld.value = Regex.Replace(chld.value, @"\\u([0-9]{1,4})\?", m => int.TryParse(m?.Groups[1]?.Value, out int result) ? Convert.ToChar(result).ToString() : "");
Outdated
Review

I agree. It would be safter to do the TryParse as suggested

I agree. It would be safter to do the TryParse as suggested
Outdated
Review

I can add the tryparse, but since the match is only looking for integers [0-9]{1,4} why would the tryparese be needed?

I can add the tryparse, but since the match is only looking for integers [0-9]{1,4} why would the tryparese be needed?
RoUsageInfo SavROLink = null;
if (_savCurROLink != null) SavROLink = _savCurROLink; if (_savCurROLink != null) SavROLink = _savCurROLink;
// Set the Display Text to the AccPageID // Set the Display Text to the AccPageID