]> git.tdb.fi Git - r2c2.git/blobdiff - source/libr2c2/train.cpp
Fix formatting of goto sensor row type
[r2c2.git] / source / libr2c2 / train.cpp
index 1447ca58df834c86f7a14d27610e0959bb38c560..ea4599fa9545eb2465d9ba2d0a1a5c85efc583d5 100644 (file)
@@ -538,7 +538,7 @@ float Train::get_reserved_distance() const
 
        float margin = 0;
        TrackIter next = blocks.back().next().track_iter();
-       if(next->get_type().is_turnout())
+       if(next && next->get_type().is_turnout())
                margin = 15*layout.get_catalogue().get_scale();
 
        return max(get_reserved_distance_until(0, false)-margin, 0.0f);