Fixed a super old null pointer dereference in TransportWindow.

This commit is contained in:
casey langen 2020-04-04 19:51:09 -07:00
parent 20ca61058c
commit e1884321ff

View File

@ -223,11 +223,12 @@ struct musik::cube::TransportDisplayCache {
if (updatedTotal != secondsTotal) {
secondsTotal = updatedTotal;
if (secondsTotal <= 0 && secondsTotal != INT_MIN) {
std::string duration =
this->track->GetString(constants::Track::DURATION);
if (duration.size()) {
secondsTotal = std::stoi(duration);
if (this->track) {
std::string duration =
this->track->GetString(constants::Track::DURATION);
if (duration.size()) {
secondsTotal = std::stoi(duration);
}
}
}