Quellcode durchsuchen

Goto: fix goto ref null access when cdb isn't loaded yet

LeoVgr vor 8 Monaten
Ursprung
Commit
f4474b7b1f
1 geänderte Dateien mit 7 neuen und 0 gelöschten Zeilen
  1. 7 0
      hide/view/CdbTable.hx

+ 7 - 0
hide/view/CdbTable.hx

@@ -166,6 +166,13 @@ class CdbTable extends hide.ui.View<{}> {
 		var sheets = [for( s in getSheets() ) s.name];
 		var index = sheets.indexOf(s.name);
 		if( index < 0 ) return;
+
+		// Tabs can be null if the sheet is opened but hasn't had time to properly initilalize, so we delay the call to this function
+		if (tabs == null) {
+			haxe.Timer.delay(() -> goto(s, line, column, scriptLine), 50);
+			return;
+		}
+
 		@:privateAccess editor.currentFilters = [];
 		tabs.currentTab = tabContents[index].parent();
 		editor.setFilter(null);