Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
6
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Switch to GitLab Next
Sign in / Register
Toggle navigation
ICSx⁵
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Labels
Merge Requests
0
Merge Requests
0
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Environments
Analytics
Analytics
CI / CD
Code Review
Insights
Issue
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
bitfire web engineering
ICSx⁵
Commits
88f97930
Unverified
Commit
88f97930
authored
Feb 16, 2016
by
Ricki Hirner
🐑
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
NPE: search Content-Type only for charset when it's present
parent
80cd6f8a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
10 deletions
+12
-10
app/build.gradle
app/build.gradle
+2
-2
app/src/main/java/at/bitfire/icsdroid/SyncAdapter.java
app/src/main/java/at/bitfire/icsdroid/SyncAdapter.java
+10
-8
No files found.
app/build.gradle
View file @
88f97930
...
...
@@ -20,8 +20,8 @@ android {
applicationId
"at.bitfire.icsdroid"
minSdkVersion
14
targetSdkVersion
22
versionCode
5
versionName
"1.1"
versionCode
6
versionName
"1.
2-alpha
1"
}
buildTypes
{
release
{
...
...
app/src/main/java/at/bitfire/icsdroid/SyncAdapter.java
View file @
88f97930
...
...
@@ -170,14 +170,16 @@ public class SyncAdapter extends AbstractThreadedSyncAdapter {
// assume UTF-8 by default [RFC 5445 3.1.4]
Charset
charset
=
Charsets
.
UTF_8
;
Matcher
m
=
regexContentTypeCharset
.
matcher
(
contentType
);
if
(
m
.
find
())
try
{
charset
=
Charset
.
forName
(
m
.
group
(
1
));
Log
.
v
(
TAG
,
"Using charset "
+
charset
.
displayName
());
}
catch
(
IllegalCharsetNameException
|
UnsupportedCharsetException
e
)
{
Log
.
e
(
TAG
,
"Illegal or unsupported character set, assuming UTF-8"
,
e
);
}
if
(
contentType
!=
null
)
{
Matcher
m
=
regexContentTypeCharset
.
matcher
(
contentType
);
if
(
m
.
find
())
try
{
charset
=
Charset
.
forName
(
m
.
group
(
1
));
Log
.
v
(
TAG
,
"Using charset "
+
charset
.
displayName
());
}
catch
(
IllegalCharsetNameException
|
UnsupportedCharsetException
e
)
{
Log
.
e
(
TAG
,
"Illegal or unsupported character set, assuming UTF-8"
,
e
);
}
}
return
charset
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment