|
@@ -4502,9 +4502,14 @@ void MainWindow::ChangeXODRJunctionID(OpenDrive *pxodr, int index, int newid)
|
|
|
char strid[255];
|
|
|
snprintf(strid,255,"%d",newid);
|
|
|
pjunction->SetId(strid);
|
|
|
- for(i=0;i<nsize;i++)
|
|
|
+ for(i=0;i<(int)(pxodr->GetRoadCount());i++)
|
|
|
{
|
|
|
Road * proad2 = pxodr->GetRoad(i);
|
|
|
+ if(proad2 == NULL)
|
|
|
+ {
|
|
|
+ qDebug("Road %d is NULL size is %d",i,nsize);
|
|
|
+ continue;
|
|
|
+ }
|
|
|
if(proad2->GetPredecessor()!= 0)
|
|
|
{
|
|
|
RoadLink * plink = proad2->GetPredecessor();
|