From 72ae4d5695b985aa67b5138ae97a8ea8a03ba5ac Mon Sep 17 00:00:00 2001 From: mlangkabel Date: Thu, 28 Sep 2017 19:39:36 +0200 Subject: [PATCH] logic: fixed crash in Java indexer tests on Linux --- src/test/helper/DumpParserClient.h | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/test/helper/DumpParserClient.h b/src/test/helper/DumpParserClient.h index 8810dc67..9c1efbbd 100644 --- a/src/test/helper/DumpParserClient.h +++ b/src/test/helper/DumpParserClient.h @@ -4,6 +4,8 @@ #include "data/parser/ParseLocation.h" #include "data/parser/ParserClient.h" +#include + class DumpParserClient : public ParserClient { public: @@ -43,9 +45,16 @@ public: const ParseLocation& location) { std::string contextNameString = contextName.getQualifiedNameWithSignature(); - if (FilePath(contextNameString).exists()) + try { - contextNameString = FilePath(contextNameString).fileName(); + if (FilePath(contextNameString).exists()) + { + contextNameString = FilePath(contextNameString).fileName(); + } + } + catch (const boost::filesystem::filesystem_error& e) + { + // do nothing and use the old contectNameString } m_dump += referenceKindToString(referenceKind) + " " + addLocationSuffix(contextNameString + " -> " + referencedName.getQualifiedNameWithSignature() + " [" + location.filePath.fileName(), location) + "]\n"; }