diff --git a/src/Binder/Binder.cpp b/src/Binder/Binder.cpp index fbf12d4..c928202 100644 --- a/src/Binder/Binder.cpp +++ b/src/Binder/Binder.cpp @@ -75,7 +75,8 @@ BoundStatement *Binder::BindIndexAssignmentStatement(const ParsedStatement *stat auto s = (ParsedIndexAssignmentStatement*) statement; auto boundIndexExpression = this -> BindIndexExpression((IndexExpression*)s->GetIndexExpression(), true); auto valueExpression = this -> BindExpression(s->GetValueExpression()); - if (boundIndexExpression->GetType()->operator!=(valueExpression->GetType().get())){ + auto boundIndexType = boundIndexExpression -> GetType(); + if (boundIndexType ->GetClass() != TypeClass ::Error && boundIndexType->operator!=(valueExpression->GetType().get())){ this -> _scriptData -> Diagnostics -> LogError(DiagnosticCode::InvalidTableValueType, statement->GetStartPosition(), statement->GetLength()); return new BoundBadStatement(); }