andpor / react-native-sqlite-storage

Full featured SQLite3 Native Plugin for React Native (Android and iOS)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

assetFilePath issue

jschloer opened this issue · comments

I'm having trouble with the assetFilePath. When setting the createFromLocation path to '/filePath', react native sqlite storage is treating it like an asset bundle path. It looks like the issue is in /src/ios/SQLite.m line 175:

            } else if ([assetFilePath characterAtIndex:0 == '~']) {

If I'm reading this right, instead of checking for a ~ character at index 0, we're checking for a character at (0=='~') which should be false/0. So I think we're essentially just saying if there is a non-zero character at position 0. I believe this was meant to be:

            } else if ([assetFilePath characterAtIndex:0] == '~') {

Though I would suggest changing to:

            } else if ([assetFilePath hasPrefix:@"~"]) {

I will submit a PR for this change now.

@jschloer - thanks for this . this certainly looks like a typo bug. I think you are correct but I will double check this...