Skip to content

AttributeError: 'NoneType' object has no attribute 'endswith' #507

Open
@churchilllake

Description

@churchilllake

Getting this traceback:

Traceback (most recent call last):

  File "/Applications/Sublime Text.app/Contents/MacOS/sublime_plugin.py", line 377, in on_query_completions

res = callback.on_query_completions(v, prefix, locations)

  File "TSCompletion in /Users/rc/Library/Application Support/Sublime Text 3/Installed Packages/TypescriptCompletion.sublime-package", line 50, in on_query_completions

  File "TSCompletion in /Users/rc/Library/Application Support/Sublime Text 3/Installed Packages/TypescriptCompletion.sublime-package", line 258, in TSC_IsTypeScript
AttributeError: 'NoneType' object has no attribute 'ends with'

On line 48, is this statement:

current_file = view.file_name()

file_name() returns None and the call to the TSC_IsTypeScript(current_file) (line 50) tries to see if the filename ends with ".ts". I have an untitled file that I'm working on, so I suppose None is a valid state for the file_name to be in. As soon as I save it, it no longer has this error, this definitely an edge case.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions