Ver Fonte

Fixed named param autocomplete crash

Brian Fiete há 3 anos atrás
pai
commit
5490af4690
1 ficheiros alterados com 7 adições e 4 exclusões
  1. 7 4
      IDEHelper/Compiler/BfCompiler.cpp

+ 7 - 4
IDEHelper/Compiler/BfCompiler.cpp

@@ -8180,11 +8180,14 @@ void BfCompiler::GenerateAutocompleteInfo()
 
 
 					auto& bestInstance = methodMatchInfo->mInstanceList[methodMatchInfo->mBestIdx];
 					auto& bestInstance = methodMatchInfo->mInstanceList[methodMatchInfo->mBestIdx];
 					auto bestMethodDef = bestInstance.mMethodDef;
 					auto bestMethodDef = bestInstance.mMethodDef;
-					for (int paramIdx = 0; paramIdx < bestMethodDef->mParams.mSize; paramIdx++)
+					if (bestMethodDef != NULL)
 					{
 					{
-						if ((paramIdx == 0) && (bestMethodDef->mMethodType == BfMethodType_Extension))
-							continue;
-						autoComplete->AddEntry(AutoCompleteEntry("param", bestMethodDef->mParams[paramIdx]->mName + ":"), filter);
+						for (int paramIdx = 0; paramIdx < bestMethodDef->mParams.mSize; paramIdx++)
+						{
+							if ((paramIdx == 0) && (bestMethodDef->mMethodType == BfMethodType_Extension))
+								continue;
+							autoComplete->AddEntry(AutoCompleteEntry("param", bestMethodDef->mParams[paramIdx]->mName + ":"), filter);
+						}
 					}
 					}
 				}
 				}