ide/CodeEditor/autocomplete: Fixed potential crash
authorJerome St-Louis <jerome@ecere.com>
Thu, 7 Aug 2014 01:52:01 +0000 (21:52 -0400)
committerJerome St-Louis <jerome@ecere.com>
Thu, 7 Aug 2014 01:52:01 +0000 (21:52 -0400)
ide/src/designer/CodeEditor.ec

index 3c5becc..2fb1955 100644 (file)
@@ -1752,7 +1752,7 @@ class CodeEditor : Window
          display.FontExtent(font, ")", 1, &parW, null);
 
          string[0] = 0;
-         if(editor.functionType)
+         if(editor.functionType && type.kind == functionType)
          {
             PrintType(type.returnType, string, true, true);
             display.FontExtent(font, string, strlen(string), &functionW, null);
@@ -1918,7 +1918,7 @@ class CodeEditor : Window
          display.FontExtent(font, ")", 1, &parW, null);
 
          string[0] = 0;
-         if(editor.functionType && type)
+         if(editor.functionType && type && type.kind == functionType)
          {
             PrintType(type.returnType, string, true, true);
             display.FontExtent(font, string, strlen(string), &functionW, null);