OSDN Git Service

[denncoCreator] fixed a crash issue.
authortkawata <tkawata@users.sourceforge.jp>
Sat, 15 Dec 2012 02:45:06 +0000 (11:45 +0900)
committertkawata <tkawata@users.sourceforge.jp>
Sat, 15 Dec 2012 02:45:06 +0000 (11:45 +0900)
Source/codeeditor/dceditscriptfolder.cpp

index 1e60306..44ef108 100644 (file)
@@ -33,13 +33,15 @@ DCEditScriptFolder::~DCEditScriptFolder()
 void DCEditScriptFolder::attach(DCCell *cell)
 {
     deattach();
-    d_attacher = DCCodeEditorScriptManager::createCustomScriptAttacher(this, cell);
+    if (cell)
+        d_attacher = DCCodeEditorScriptManager::createCustomScriptAttacher(this, cell);
 }
 
 void DCEditScriptFolder::attach(DCCellCode *cellCode)
 {
     deattach();
-    d_attacher = DCCodeEditorScriptManager::createCellCodeScriptAttacher(this, cellCode);
+    if (cellCode)
+        d_attacher = DCCodeEditorScriptManager::createCellCodeScriptAttacher(this, cellCode);
 }
 
 void DCEditScriptFolder::deattach()