Route toString() Exception fix:
- toString() throws exception when invoked on 'noise' vehicles The routes made for them dont have District and Mashier set. Accessing name() from a null method throws null ptr ex. Signed-off-by: HeshamTB <hishaminv@gmail.com>
This commit is contained in:
parent
e28a593280
commit
0b4e259495
@ -42,10 +42,11 @@ public class Route {
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
StringBuilder s = new StringBuilder();
|
StringBuilder s = new StringBuilder();
|
||||||
s.append(super.toString())
|
s.append(super.toString())
|
||||||
.append("\n").append(String.format("%s:%s",getHotelArea().name(),getMashier().name()))
|
.append("\n").append(String.format("%s:%s",getHotelArea(),getMashier()))
|
||||||
.append("\n")
|
.append("\n")
|
||||||
.append("Length: ").append(getTotalLength())
|
.append("Length: ").append(getTotalLength())
|
||||||
.append("\n")
|
.append("\n")
|
||||||
|
Loading…
Reference in New Issue
Block a user