Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dartdoc throws exception attempting to find offset inside empty file #1938

Closed
isoos opened this issue Feb 20, 2019 · 1 comment · Fixed by #2034
Closed

dartdoc throws exception attempting to find offset inside empty file #1938

isoos opened this issue Feb 20, 2019 · 1 comment · Fixed by #2034
Labels
P1 A high priority bug; for example, a single project is unusable or has many test failures type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)

Comments

@isoos
Copy link
Contributor

isoos commented Feb 20, 2019

We've found it while running dartdoc on native_widgets 1.0.0+4.

Unhandled exception:
RangeError (start): Invalid value: Only valid value is 0: 1
#0      _StringBase.indexOf (dart:core/runtime/libstring_patch.dart:334:7)
#1      String.indexOf (dart:core/runtime/libstring_patch.dart:1024:18)
#2      _createLineNumbersMap (package:dartdoc/src/line_number_cache.dart:30:23)
#3      LineNumberCache.lineAndColumn.<anonymous closure> (package:dartdoc/src/line_number_cache.dart:47:21)
#4      __InternalLinkedHashMap&_HashVMBase&MapMixin&_LinkedHashMapMixin.putIfAbsent (dart:collection/runtime/libcompact_hash.dart:281:23)
#5      LineNumberCache.lineAndColumn (package:dartdoc/src/line_number_cache.dart:46:32)
#6      ModelElement.lineAndColumn (package:dartdoc/src/model.dart:3499:40)
#7      new SourceLinker.fromElement (package:dartdoc/src/source_linker.dart:88:27)
#8      ModelElement.sourceHref (package:dartdoc/src/model.dart:3222:25)
@jcollins-g jcollins-g added type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) P1 A high priority bug; for example, a single project is unusable or has many test failures labels Feb 20, 2019
@jcollins-g jcollins-g changed the title RangeError (0.28.2) dartdoc throws exception attempting to find offset inside empty file Feb 20, 2019
@jcollins-g
Copy link
Contributor

the referenced package contains a file, lib/scaffold/ios_controllers/navigation_controller.dart, of zero length.

It is valid to have a dart library of zero length, but dartdoc doesn't handle this case appropriately.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P1 A high priority bug; for example, a single project is unusable or has many test failures type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants