From 211c4654c260e4dc68f64316c240d5494c79e9fd Mon Sep 17 00:00:00 2001
From: Fleeym <61891787+Fleeym@users.noreply.github.com>
Date: Sat, 28 Dec 2024 23:08:00 +0200
Subject: [PATCH] fix: fix 2 sneaky crashes

---
 CMakeLists.txt                   | 1 -
 src/hooks/custom_song_widget.cpp | 3 ++-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 7414987..2e617b3 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -20,7 +20,6 @@ file(GLOB SOURCES
 	src/*.cpp
 )
 
-
 add_library(${PROJECT_NAME} SHARED ${SOURCES})
 target_include_directories(${PROJECT_NAME} PUBLIC include src)
 
diff --git a/src/hooks/custom_song_widget.cpp b/src/hooks/custom_song_widget.cpp
index 940a347..01a1ce2 100644
--- a/src/hooks/custom_song_widget.cpp
+++ b/src/hooks/custom_song_widget.cpp
@@ -228,7 +228,7 @@ class $modify(JBSongWidget, CustomSongWidget) {
 
         m_fields->nongs = nongs;
         this->createSongLabels(nongs);
-        if (!nongs->isDefaultActive()) {
+        if (!nongs->isDefaultActive() && m_deleteBtn) {
             m_deleteBtn->setVisible(false);
         }
     }
@@ -363,6 +363,7 @@ class $modify(JBSongWidget, CustomSongWidget) {
         if (m_songs.size() == 0 && m_sfx.size() == 0 && !m_isMusicLibrary) {
             if (m_fields->sizeIdLabel != nullptr) {
                 m_fields->sizeIdLabel->removeFromParent();
+                m_fields->sizeIdLabel = nullptr;
             }
             auto data = NongManager::get().getNongs(songID).value();