Skip to content

Commit

Permalink
Fix potential crash when specifying Trinity node names
Browse files Browse the repository at this point in the history
  • Loading branch information
rrwick committed May 5, 2015
1 parent 3ecc864 commit 78cb9b5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions program/globals.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,9 @@ long long getFullTrinityNodeNumberFromName(QString name)
{
QStringList nameParts = name.split("-");

if (nameParts.size() < 3)
return 0;

int transcript = nameParts[0].toInt();
int component = nameParts[1].toInt();
long long nodeNumber = nameParts[2].toLongLong();
Expand Down
2 changes: 2 additions & 0 deletions ui/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1064,6 +1064,8 @@ std::vector<DeBruijnNode *> MainWindow::getNodesFromLineEdit(QLineEdit * lineEdi
for (int i = 0; i < nodesList.size(); ++i)
{
long long nodeNumber;
if (nodesList.at(i) == "")
continue;
if (g_assemblyGraph->m_trinityGraph)
nodeNumber = getFullTrinityNodeNumberFromName(nodesList.at(i));
else
Expand Down

0 comments on commit 78cb9b5

Please sign in to comment.