Skip to content

Commit

Permalink
Merge pull request #20 from uklotzde/jmigual-library-redesign-hotfix
Browse files Browse the repository at this point in the history
Hotfix for SIGSEGV
  • Loading branch information
daschuer authored Jul 6, 2017
2 parents 40c27aa + 356585b commit b156da1
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/library/features/crates/cratefeature.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ CrateFeature::CrateFeature(UserSettingsPointer pConfig,
: LibraryFeature(pConfig, pLibrary, pTrackCollection, parent),
m_cratesIcon(":/images/library/ic_library_crates.png"),
m_lockedCrateIcon(":/images/library/ic_library_locked.png"),
m_pTrackCollection(pTrackCollection) {
m_pTrackCollection(pTrackCollection),
m_pCrateTableModel(nullptr) {

initActions();

Expand Down Expand Up @@ -321,8 +322,13 @@ bool CrateFeature::activateCrate(CrateId crateId) {
return false;
}
m_lastRightClickedIndex = index;
m_pCrateTableModel->selectCrate(crateId);
emit(showTrackModel(m_pCrateTableModel));
// TODO(XXX): How to select the newly created crate without
// a corresponding table model? m_pCrateTableModel = nullptr
// when creating crates by clicking the link on the HTML view.
if (m_pCrateTableModel) {
m_pCrateTableModel->selectCrate(crateId);
emit(showTrackModel(m_pCrateTableModel));
}
emit(enableCoverArtDisplay(true));
// Update selection
emit(featureSelect(this, m_lastRightClickedIndex));
Expand Down

0 comments on commit b156da1

Please sign in to comment.