<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">From 277626d9d3482fe0c64ad66a30c8d7dc7416f81b Mon Sep 17 00:00:00 2001
From: John Floyd &lt;jfloyd@bigpond.net.au&gt;
Date: Wed, 24 Jun 2020 13:39:31 +1000
Subject: [PATCH] [QMS-217] Fix Crash in Profile

Routino_GetProfiles returns a NULL result if profile is not in profiles.
Catch this error and display error message.

This coding error predates latest profiles work.
---
 changelog.txt                                   | 1 +
 src/qmapshack/gis/rte/router/CRouterRoutino.cpp | 8 ++++++++
 2 files changed, 9 insertions(+)

diff --git a/src/qmapshack/gis/rte/router/CRouterRoutino.cpp b/src/qmapshack/gis/rte/router/CRouterRoutino.cpp
index 91ba62c3..cc32674c 100644
--- a/src/qmapshack/gis/rte/router/CRouterRoutino.cpp
+++ b/src/qmapshack/gis/rte/router/CRouterRoutino.cpp
@@ -378,6 +378,10 @@ void CRouterRoutino::calcRoute(const IGisItem::key_t&amp; key)
         QString strLanguage = comboLanguage-&gt;currentData(Qt::UserRole).toString();
 
         Routino_Profile *profile         = Routino_GetProfile(strProfile.toUtf8());
+        if( profile == NULL )
+        {
+            throw tr("Required profile '%1' is not the current profiles file.").arg(strProfile);
+        }
         Routino_Translation *translation = Routino_GetTranslation(strLanguage.toUtf8());
 
         int res = Routino_ValidateProfile(data, profile);
@@ -466,6 +470,10 @@ int CRouterRoutino::calcRoute(const QPointF&amp; p1, const QPointF&amp; p2, QPolygonF&amp; c
         QString strLanguage     = comboLanguage-&gt;currentData(Qt::UserRole).toString();
 
         Routino_Profile *profile         = Routino_GetProfile(strProfile.toUtf8());
+        if( profile == NULL )
+        {
+            throw tr("Required profile '%1' is not the current profiles file.").arg(strProfile);
+        }
         Routino_Translation *translation = Routino_GetTranslation(strLanguage.toUtf8());
 
 
</pre></body></html>